Home

This document is a cache from http://www.spidertg.com/cmsv5/images/stories/eBook_Libarary/Developer/Putting%20SharePoint%20to%20Work%20for%20You.pdf


Putting Share Point toWorkfor You

Document source : www.spidertg.com


string strDescription,
string strFieldsInnerXml,
IDictionary<string, string> properties,
int templateID,
out string strNewGuid,
out XmlNode nodeUpdateResult
) {
XmlDocument xmlDoc = new XmlDocument();
// delete list if it exists
if (ListExists(listService, strListName))
listService.DeleteList(strListName);
// add list
XmlNode nodeAddResult = listService.AddList(
strListName,
strDescription,
templateID
);
strNewGuid = nodeAddResult.Attributes["ID"].Value;
// fields
XmlNode nodeFields = xmlDoc.CreateElement("Fields");
nodeFields.InnerXml = strFieldsInnerXml;
// properties
XmlNode nodeList = null;
if (properties != null) {
nodeList = xmlDoc.CreateElement("List");
foreach (KeyValuePair<string, string> property in properties) {
XmlAttribute attribute = xmlDoc.CreateAttribute(property.Key);
attribute.Value = property.Value;
nodeList.Attributes.Append(attribute);
}
}
// add fields
nodeUpdateResult = listService.UpdateList(strNewGuid, nodeList,
nodeFields, null, null, null);
}
/// <summary>
/// Creates a new SharePoint list or any derivitave such as a document library.
/// This method will not work if any field contains a self-referential relation-
ship.
/// </summary>
/// <param name="listService">The lists web service proxy.</param>
/// <param name="strListName">The name of the new list.</param>
/// <param name="strDescription">A description of the new list.</param>
/// <param name="strFieldsInnerXml">
/// The list of fields in the new list. For example:
35
Putting SharePoint to Work for You, an Internet.com Developer eBook. Copyright 2008, Jupitermedia Corp.
Putting SharePoint to Work for You
[
]







Summary :

properties, int templateID, out string strNewGuid, out XmlNode nodeUpdateResult ) { XmlDocument xmlDoc = new XmlDocument(); // add list XmlNode nodeAddResult = listService.AddList( strListName, strDescription, templateID ); } } // add fields nodeUpdateResult = listService.UpdateList(strNewGuid, nodeList, nodeFields, null, null, null);


Tags : list,null,new,xmlnode,properties,ltparam,nodelist,work,sharepoint,string,fields,nodeupdateresult,strlistname





Terms    |    Link pdf-search-files.com    |    Site Map
   |    Content Removal Notice   
   |    Contact   

All books are the property of their respective owners.
Please respect the publisher and the author for their creations if their books copyrighted