C# Class SampleWebApp.SharePointContextProvider

Provides SharePointContext instances.
Exibir arquivo Open project: upeo/inbloom-dotnet Class Usage Examples

Public Methods

Method Description
CheckRedirectionStatus ( HttpContext httpContext, Uri &redirectUrl ) : RedirectionStatus

Checks if it is necessary to redirect to SharePoint for user to authenticate.

CheckRedirectionStatus ( System.Web.HttpContextBase httpContext, Uri &redirectUrl ) : RedirectionStatus

Checks if it is necessary to redirect to SharePoint for user to authenticate.

CreateSharePointContext ( HttpRequest httpRequest ) : SharePointContext

Creates a SharePointContext instance with the specified HTTP request.

CreateSharePointContext ( System.Web.HttpRequestBase httpRequest ) : SharePointContext

Creates a SharePointContext instance with the specified HTTP request.

GetSharePointContext ( HttpContext httpContext ) : SharePointContext

Gets a SharePointContext instance associated with the specified HTTP context.

GetSharePointContext ( System.Web.HttpContextBase httpContext ) : SharePointContext

Gets a SharePointContext instance associated with the specified HTTP context.

Register ( SharePointContextProvider provider ) : void

Registers the specified SharePointContextProvider instance as current. It should be called by Application_Start() in Global.asax.

Protected Methods

Method Description
CreateSharePointContext ( Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, System.Web.HttpRequestBase httpRequest ) : SharePointContext

Creates a SharePointContext instance.

LoadSharePointContext ( System.Web.HttpContextBase httpContext ) : SharePointContext

Loads the SharePointContext instance associated with the specified HTTP context.

SaveSharePointContext ( SharePointContext spContext, System.Web.HttpContextBase httpContext ) : void

Saves the specified SharePointContext instance associated with the specified HTTP context. null is accepted for clearing the SharePointContext instance associated with the HTTP context.

ValidateSharePointContext ( SharePointContext spContext, System.Web.HttpContextBase httpContext ) : bool

Validates if the given SharePointContext can be used with the specified HTTP context.

Private Methods

Method Description
SharePointContextProvider ( ) : System

Initializes the default SharePointContextProvider instance.

Method Details

CheckRedirectionStatus() public static method

Checks if it is necessary to redirect to SharePoint for user to authenticate.
public static CheckRedirectionStatus ( HttpContext httpContext, Uri &redirectUrl ) : RedirectionStatus
httpContext System.Web.HttpContext The HTTP context.
redirectUrl System.Uri The redirect url to SharePoint if the status is ShouldRedirect. Null if the status is Ok or CanNotRedirect.
return RedirectionStatus

CheckRedirectionStatus() public static method

Checks if it is necessary to redirect to SharePoint for user to authenticate.
public static CheckRedirectionStatus ( System.Web.HttpContextBase httpContext, Uri &redirectUrl ) : RedirectionStatus
httpContext System.Web.HttpContextBase The HTTP context.
redirectUrl System.Uri The redirect url to SharePoint if the status is ShouldRedirect. Null if the status is Ok or CanNotRedirect.
return RedirectionStatus

CreateSharePointContext() public method

Creates a SharePointContext instance with the specified HTTP request.
public CreateSharePointContext ( HttpRequest httpRequest ) : SharePointContext
httpRequest HttpRequest The HTTP request.
return SharePointContext

CreateSharePointContext() public method

Creates a SharePointContext instance with the specified HTTP request.
public CreateSharePointContext ( System.Web.HttpRequestBase httpRequest ) : SharePointContext
httpRequest System.Web.HttpRequestBase The HTTP request.
return SharePointContext

CreateSharePointContext() protected abstract method

Creates a SharePointContext instance.
protected abstract CreateSharePointContext ( Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, System.Web.HttpRequestBase httpRequest ) : SharePointContext
spHostUrl System.Uri The SharePoint host url.
spAppWebUrl System.Uri The SharePoint app web url.
spLanguage string The SharePoint language.
spClientTag string The SharePoint client tag.
spProductNumber string The SharePoint product number.
httpRequest System.Web.HttpRequestBase The HTTP request.
return SharePointContext

GetSharePointContext() public method

Gets a SharePointContext instance associated with the specified HTTP context.
public GetSharePointContext ( HttpContext httpContext ) : SharePointContext
httpContext System.Web.HttpContext The HTTP context.
return SharePointContext

GetSharePointContext() public method

Gets a SharePointContext instance associated with the specified HTTP context.
public GetSharePointContext ( System.Web.HttpContextBase httpContext ) : SharePointContext
httpContext System.Web.HttpContextBase The HTTP context.
return SharePointContext

LoadSharePointContext() protected abstract method

Loads the SharePointContext instance associated with the specified HTTP context.
protected abstract LoadSharePointContext ( System.Web.HttpContextBase httpContext ) : SharePointContext
httpContext System.Web.HttpContextBase The HTTP context.
return SharePointContext

Register() public static method

Registers the specified SharePointContextProvider instance as current. It should be called by Application_Start() in Global.asax.
public static Register ( SharePointContextProvider provider ) : void
provider SharePointContextProvider The SharePointContextProvider to be set as current.
return void

SaveSharePointContext() protected abstract method

Saves the specified SharePointContext instance associated with the specified HTTP context. null is accepted for clearing the SharePointContext instance associated with the HTTP context.
protected abstract SaveSharePointContext ( SharePointContext spContext, System.Web.HttpContextBase httpContext ) : void
spContext SharePointContext The SharePointContext instance to be saved, or null.
httpContext System.Web.HttpContextBase The HTTP context.
return void

ValidateSharePointContext() protected abstract method

Validates if the given SharePointContext can be used with the specified HTTP context.
protected abstract ValidateSharePointContext ( SharePointContext spContext, System.Web.HttpContextBase httpContext ) : bool
spContext SharePointContext The SharePointContext.
httpContext System.Web.HttpContextBase The HTTP context.
return bool