Freigeben über


SPFeatureDefinitionCollection Class

Represents a collection of SPFeatureDefinition objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPFeatureDefinition>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPFeatureDefinition>
      Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

<GuidAttribute("E8FDC5F0-9083-457f-AF33-5FB236AAB658")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPFeatureDefinitionCollection _
    Inherits SPPersistedChildCollection(Of SPFeatureDefinition)

Dim instance As SPFeatureDefinitionCollection
[GuidAttribute("E8FDC5F0-9083-457f-AF33-5FB236AAB658")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPFeatureDefinitionCollection : SPPersistedChildCollection<SPFeatureDefinition>

Remarks

Use the FeatureDefinitions property of the SPFarm class to get the collection of Feature definitions installed in the server farm. To add a Feature definition to the collection, use one of the Add methods of the SPFeatureDefinitionCollection class.

Warning

Using the SPFeatureDefinition.SPFeatureDefinition constructor to create a Feature definition object is not supported, and returns a NullReferenceException if you attempt to implement members of an object created through the constructor.

Use an indexer to return a single Feature definition from the collection. For example, if the collection is assigned to a variable named myDefinitions, use myDefinitions[index] in Microsoft Visual C#, or myDefinitions(index) in Visual Basic, where index is the GUID of the Feature.

Thread Safety

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

See Also

Reference

SPFeatureDefinitionCollection Members

Microsoft.SharePoint.Administration Namespace