Class FeatureExtensions
Class that deals with feature activation and deactivation
Inheritance
System.Object
FeatureExtensions
Assembly: PnP.Framework.dll
Syntax
public static class FeatureExtensions : object
Methods
Activates a site collection or site scoped feature
Declaration
public static void ActivateFeature(this Site site, Guid featureID, bool sandboxed = false, int pollingIntervalSeconds = 30)
Parameters
Site
site
Site to be processed
|
Guid
featureID
ID of the feature to activate
|
System.Boolean
sandboxed
Set to true if the feature is defined in a sandboxed solution
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Activates a site collection or site scoped feature
Declaration
public static void ActivateFeature(this Web web, Guid featureID, bool sandboxed = false, int pollingIntervalSeconds = 30)
Parameters
Web
web
Web to be processed - can be root web or sub web
|
Guid
featureID
ID of the feature to activate
|
System.Boolean
sandboxed
Set to true if the feature is defined in a sandboxed solution
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Activates a site collection or site scoped feature
Declaration
public static async Task ActivateFeatureAsync(this Site site, Guid featureID, bool sandboxed = false, int pollingIntervalSeconds = 30)
Parameters
Site
site
Site to be processed
|
Guid
featureID
ID of the feature to activate
|
System.Boolean
sandboxed
Set to true if the feature is defined in a sandboxed solution
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Returns
Activates a site collection or site scoped feature
Declaration
public static async Task ActivateFeatureAsync(this Web web, Guid featureID, bool sandboxed = false, int pollingIntervalSeconds = 30)
Parameters
Web
web
Web to be processed - can be root web or sub web
|
Guid
featureID
ID of the feature to activate
|
System.Boolean
sandboxed
Set to true if the feature is defined in a sandboxed solution
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Returns
Deactivates a site collection or site scoped feature
Declaration
public static void DeactivateFeature(this Site site, Guid featureID, int pollingIntervalSeconds = 30)
Parameters
Site
site
Site to be processed
|
Guid
featureID
ID of the feature to deactivate
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Deactivates a site collection or site scoped feature
Declaration
public static void DeactivateFeature(this Web web, Guid featureID, int pollingIntervalSeconds = 30)
Parameters
Web
web
Web to be processed - can be root web or sub web
|
Guid
featureID
ID of the feature to deactivate
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Deactivates a site collection or site scoped feature
Declaration
public static async Task DeactivateFeatureAsync(this Site site, Guid featureID, int pollingIntervalSeconds = 30)
Parameters
Site
site
Site to be processed
|
Guid
featureID
ID of the feature to deactivate
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Returns
Deactivates a site collection or site scoped feature
Declaration
public static async Task DeactivateFeatureAsync(this Web web, Guid featureID, int pollingIntervalSeconds = 30)
Parameters
Web
web
Web to be processed - can be root web or sub web
|
Guid
featureID
ID of the feature to deactivate
|
System.Int32
pollingIntervalSeconds
The time in seconds between polls for "IsActive"
|
Returns
Checks if a feature is active
Declaration
public static bool IsFeatureActive(this Site site, Guid featureID)
Parameters
Site
site
Site to operate against
|
Guid
featureID
ID of the feature to check
|
Returns
System.Boolean
True if active, false otherwise
|
Checks if a feature is active
Declaration
public static bool IsFeatureActive(this Web web, Guid featureID)
Parameters
Web
web
Web to operate against
|
Guid
featureID
ID of the feature to check
|
Returns
System.Boolean
True if active, false otherwise
|
Checks if a feature is active
Declaration
public static async Task<bool> IsFeatureActiveAsync(this Site site, Guid featureID)
Parameters
Site
site
Site to operate against
|
Guid
featureID
ID of the feature to check
|
Returns
Task<System.Boolean>
True if active, false otherwise
|
Checks if a feature is active
Declaration
public static async Task<bool> IsFeatureActiveAsync(this Web web, Guid featureID)
Parameters
Web
web
Web to operate against
|
Guid
featureID
ID of the feature to check
|
Returns
Task<System.Boolean>
True if active, false otherwise
|