List - Classe
Represents a list on a SharePoint Web site.
Hiérarchie d’héritage
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.SecurableObject
Microsoft.SharePoint.Client.List
Espace de noms : Microsoft.SharePoint.Client
Assemblys : Microsoft.SharePoint.Client.Silverlight (dans Microsoft.SharePoint.Client.Silverlight.dll); Microsoft.SharePoint.Client.Phone (dans Microsoft.SharePoint.Client.Phone.dll) Microsoft.SharePoint.Client (dans Microsoft.SharePoint.Client.dll)
Syntaxe
'Déclaration
Public Class List _
Inherits SecurableObject
'Utilisation
Dim instance As List
public class List : SecurableObject
Remarques
The BrowserFileHandling, DataSource, EffectiveBasePermissions, HasUniqueRoleAssignments, IsAttachmentLibrary, OnQuickLaunch, SchemaXml, ValidationFormula and ValidationMessage properties are not included in the default scalar property set for this type. TheDocument library templates sample app for SharePoint shows how to use this object.
Exemples
This code example creates a new discussion board list on the current site.
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class ListExample
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
ListCreationInformation newListInfo = new ListCreationInformation();
newListInfo.Title = "New Discussion Board";
newListInfo.TemplateType = (int)ListTemplateType.DiscussionBoard;
List newList = site.Lists.Add(newListInfo);
clientContext.Load(newList);
clientContext.ExecuteQuery();
Console.WriteLine("Added Discussion Board: " + newList.Title);
}
}
}
Cohérence de thread
Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.