Feature class

Represents an activated feature.

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client.Phone (in Microsoft.SharePoint.Client.Phone.dll)  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

public sealed class Feature : ClientObject

This code example displays the identifiers of the current website’s active features.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class FeatureExample
    {
        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);
        }

    }
}


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft