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.String
name
The name of the event receiver (needs to be unique among the event receivers registered on this site) |
System.String
url
The URL of the remote WCF service that handles the event |
EventReceiverType
eventReceiverType
|
EventReceiverSynchronization
synchronization
|
System.Boolean
force
If True any event already registered with the same name will be removed first. |
EventReceiverDefinition
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.String
name
The name of the event receiver (needs to be unique among the event receivers registered on this site) |
System.String
url
The URL of the remote WCF service that handles the event |
EventReceiverType
eventReceiverType
The type of event for the event receiver. |
EventReceiverSynchronization
synchronization
An enumeration that specifies the synchronization state for the event receiver. |
System.Int32
sequenceNumber
An integer that represents the relative sequence of the event. |
System.Boolean
force
If True any event already registered with the same name will be removed first. |
EventReceiverDefinition
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 |
EventReceiverDefinition
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.String
name
The name of the receiver |
EventReceiverDefinition
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.String
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.String
accessToken
Graph access token (groups.read.all) |
AzureEnvironment
azureEnvironment
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.Boolean
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.String
classificationValue
The new value for the Site Classification |
System.String
accessToken
The OAuth Access Token to consume Microsoft Graph, required only for GROUP#0 site collections |
AzureEnvironment
azureEnvironment
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). |