Search Results for

    Show / Hide Table of Contents

    Class SiteExtensions

    Inheritance
    System.Object
    SiteExtensions
    Namespace: Microsoft.SharePoint.Client
    Assembly: PnP.Framework.dll
    Syntax
    public static class SiteExtensions : object

    Methods

    AddRemoteEventReceiver(Site, String, String, EventReceiverType, EventReceiverSynchronization, Boolean)

    Registers a remote event receiver

    Declaration
    public static EventReceiverDefinition AddRemoteEventReceiver(this Site site, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, bool force)
    Parameters
    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.

    Returns
    EventReceiverDefinition

    Returns an EventReceiverDefinition if succeeded. Returns null if failed.

    AddRemoteEventReceiver(Site, String, String, EventReceiverType, EventReceiverSynchronization, Int32, Boolean)

    Registers a remote event receiver

    Declaration
    public static EventReceiverDefinition AddRemoteEventReceiver(this Site site, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, int sequenceNumber, bool force)
    Parameters
    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.

    Returns
    EventReceiverDefinition

    Returns an EventReceiverDefinition if succeeded. Returns null if failed.

    GetEventReceiverById(Site, Guid)

    Returns an event receiver definition

    Declaration
    public static EventReceiverDefinition GetEventReceiverById(this Site site, Guid id)
    Parameters
    Site site

    site collection to process

    Guid id

    The id of event receiver

    Returns
    EventReceiverDefinition

    Returns an EventReceiverDefinition if succeeded. Returns null if failed.

    GetEventReceiverByName(Site, String)

    Returns an event receiver definition

    Declaration
    public static EventReceiverDefinition GetEventReceiverByName(this Site site, string name)
    Parameters
    Site site

    site collection to process

    System.String name

    The name of the receiver

    Returns
    EventReceiverDefinition

    Returns an EventReceiverDefinition if succeeded. Returns null if failed.

    GetSiteClassification(Site)

    Retrieves the current value for the Site Classification of a Site Collection

    Declaration
    public static string GetSiteClassification(this Site site)
    Parameters
    Site site

    The target site

    Returns
    System.String

    The classification for the site

    HasTeamsTeam(Site, String, AzureEnvironment)

    Checks if this site collection has a Teams team linked

    Declaration
    public static bool HasTeamsTeam(this Site site, string accessToken, AzureEnvironment azureEnvironment = default(AzureEnvironment))
    Parameters
    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).

    Returns
    System.Boolean

    True if there's a team

    IsCommunicationSite(Site)

    Checks if the current Site Collection is a "modern" Communication Site

    Declaration
    public static Boolean IsCommunicationSite(this Site site)
    Parameters
    Site site

    The target site

    Returns
    Boolean

    Returns true if the site is a Communication Site

    IsModernTeamSite(Site)

    Checks if the current Site Collection is a "modern" Team Site

    Declaration
    public static Boolean IsModernTeamSite(this Site site)
    Parameters
    Site site

    The target site

    Returns
    Boolean

    Returns true if the site is a Team Site

    IsTeamChannelSite(Site)

    Checks if the current Site Collection is a "Teamchannel" Team Site

    Declaration
    public static Boolean IsTeamChannelSite(this Site site)
    Parameters
    Site site

    Returns
    Boolean

    SetSiteClassification(Site, String, String, AzureEnvironment)

    Retrieves the current value for the Site Classification of a Site Collection

    Declaration
    public static void SetSiteClassification(this Site site, string classificationValue, string accessToken = null, AzureEnvironment azureEnvironment = default(AzureEnvironment))
    Parameters
    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).

    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer