Class SiteExtensions
Inheritance
System.Object
SiteExtensions
Namespace: Microsoft.SharePoint.Client
Assembly: PnP.Framework.dll
Syntax
public static class SiteExtensions : object
public static class SiteExtensions : object
Registers a remote event receiver
public static EventReceiverDefinition AddRemoteEventReceiver(this Site site, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, bool force)
Site
site
The site collection to process |
System. The name of the event receiver (needs to be unique among the event receivers registered on this site) |
System. The URL of the remote WCF service that handles the event |
Event
|
Event
|
System. If True any event already registered with the same name will be removed first. |
Event Returns an EventReceiverDefinition if succeeded. Returns null if failed. |
Registers a remote event receiver
public static EventReceiverDefinition AddRemoteEventReceiver(this Site site, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, int sequenceNumber, bool force)
Site
site
The site colletion to process |
System. The name of the event receiver (needs to be unique among the event receivers registered on this site) |
System. The URL of the remote WCF service that handles the event |
Event The type of event for the event receiver. |
Event An enumeration that specifies the synchronization state for the event receiver. |
System. An integer that represents the relative sequence of the event. |
System. If True any event already registered with the same name will be removed first. |
Event Returns an EventReceiverDefinition if succeeded. Returns null if failed. |
Returns an event receiver definition
public static EventReceiverDefinition GetEventReceiverById(this Site site, Guid id)
Site
site
site collection to process |
Guid
id
The id of event receiver |
Event Returns an EventReceiverDefinition if succeeded. Returns null if failed. |
Returns an event receiver definition
public static EventReceiverDefinition GetEventReceiverByName(this Site site, string name)
Site
site
site collection to process |
System. The name of the receiver |
Event Returns an EventReceiverDefinition if succeeded. Returns null if failed. |
Retrieves the current value for the Site Classification of a Site Collection
public static string GetSiteClassification(this Site site)
Site
site
The target site |
System. The classification for the site |
Checks if this site collection has a Teams team linked
public static bool HasTeamsTeam(this Site site, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Site
site
Site collection |
System. Graph access token (groups.read.all) |
Azure Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |
System. True if there's a team |
Checks if the current Site Collection is a "modern" Communication Site
public static Boolean IsCommunicationSite(this Site site)
Site
site
The target site |
Boolean
Returns true if the site is a Communication Site |
Checks if the current Site Collection is a "modern" Team Site
public static Boolean IsModernTeamSite(this Site site)
Site
site
The target site |
Boolean
Returns true if the site is a Team Site |
Checks if the current Site Collection is a "Teamchannel" Team Site
public static Boolean IsTeamChannelSite(this Site site)
Site
site
|
Boolean
|
Retrieves the current value for the Site Classification of a Site Collection
public static void SetSiteClassification(this Site site, string classificationValue, string accessToken = null, AzureEnvironment azureEnvironment = default(AzureEnvironment))
Site
site
The target site |
System. The new value for the Site Classification |
System. The OAuth Access Token to consume Microsoft Graph, required only for GROUP#0 site collections |
Azure Defines the Azure Cloud Deployment. This is used to determine the MS Graph EndPoint to call which differs per Azure Cloud deployments. Defaults to Production (graph.microsoft.com). |