SPElementDefinition Class
Serves as the base class for implementing element types within SharePoint Foundation.
System.Object
Microsoft.SharePoint.Administration.SPElementDefinition
Microsoft.SharePoint.Administration.SPUserMigratorElement
Microsoft.SharePoint.Administration.SPElementDefinition
Microsoft.SharePoint.Administration.SPUserMigratorElement
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Custom element types must derive from the SPElementDefinition class.
Use the GetElementDefinitions method of the SPFeatureDefinition class to return the collection of element definitions that are used in a Feature definition.
The following example iterates through all the Features in a site collection and uses the GetElementDefinitions method to return all the element definitions of the Features.
SPSite site = new SPSite("http://localhost"); SPFeatureCollection featureCollection = site.Features; foreach (SPFeature feature in featureCollection) { SPFeatureDefinition featureDefinition = feature.Definition; SPElementDefinitionCollection elementDefinitionCollection = featureDefinition.GetElementDefinitions(System.Globalization.CultureInfo.InvariantCulture); foreach (SPElementDefinition elementDefinition in elementDefinitionCollection) { Console.WriteLine(elementDefinition.Id); } }