SPFeatureReceiverProperties Class
Represents the properties of a Feature installation, uninstallation, activation, or deactivation event.
Namespace:
Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
The SPFeatureReceiverProperties class provides access to event properties, such as the Feature instance that has been created, the Feature definition, or the parent object of the Feature, for example, an SPWeb object.
Code example
$0Code example showing usage of SPFeatureReceiver:$0
$0$0
$0
$0public class MainSiteEventReceiver : SPFeatureReceiver {$0
$0$0
$0
$0 public override void FeatureActivated(SPFeatureReceiverProperties properties) {$0
$0 SPSite siteCollection = properties.Feature.Parent as SPSite;$0
$0 if (siteCollection != null) {$0
$0 SPWeb site = siteCollection.RootWeb;$0
$0 // other code $0
$0}$0
$0}$0
- 8/8/2011
- Phani_tpk