FeatureCollection 类

表示SPFeature对象的集合。

继承层次结构

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.ClientObjectCollection
      Microsoft.SharePoint.Client.ClientObjectCollection<Feature>
        Microsoft.SharePoint.Client.FeatureCollection

命名空间:  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 NotInheritable Class FeatureCollection _
    Inherits ClientObjectCollection(Of Feature)
用法
Dim instance As FeatureCollection
public sealed class FeatureCollection : ClientObjectCollection<Feature>

示例

此代码示例显示当前网站的活动功能的标识符。

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class FeatureCollectionExample
    {
        static void Main()
        {

            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            FeatureCollection collFeature = site.Features;

            clientContext.Load(collFeature);
            clientContext.ExecuteQuery();

            foreach (Feature oneFeature in collFeature)
               Console.WriteLine("Feature ID: {0}", oneFeature.DefinitionId);
        }

    }
}

线程安全性

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

另请参阅

引用

FeatureCollection 成员

Microsoft.SharePoint.Client 命名空间