List 类

Represents a list on a SharePoint Web site.

继承层次结构

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.SecurableObject
      Microsoft.SharePoint.Client.List

命名空间:  Microsoft.SharePoint.Client
程序集:   Microsoft.SharePoint.Client.Silverlight(位于 Microsoft.SharePoint.Client.Silverlight.dll 中);  Microsoft.SharePoint.Client.Phone(位于 Microsoft.SharePoint.Client.Phone.dll 中)  Microsoft.SharePoint.Client(位于 Microsoft.SharePoint.Client.dll 中)

语法

声明
Public Class List _
    Inherits SecurableObject
用法
Dim instance As List
public class List : SecurableObject

备注

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.

示例

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);

        }
    }
}

线程安全性

该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

引用

List 成员

Microsoft.SharePoint.Client 命名空间