C# Class Facebook.Graph.GraphDesktopSession

Represents a Desktop session of the OpenGraph API.

Developers seeking to leverage the OpenGraph API via a desktop application should utilize the OpenGraphDesktopSession class. While it allows a user's session token to be provided, it also presents a callback to automatically refresh the session. This allows the consuming application to present the Facebook authentication UI in its own, platform-specific way (thus eliminating any dependence on Windows Forms, WPF, or Gtk# within this library).

Web server implementers should prefer to use the OpenGraphAuthenticatedSession class instead, because of the single-threaded nature of the callback. However, if you are using a session with the offline_access permission, because of its long-running nature and the unlikelihood that you'll be able to prevent the callback from returning in a web session. For more information, view the conceptual help topic "Obtaining Authentication Tokens with a Web Application," which covers ASP.NET Web Forms, MVC 1.0, and MVC 2.0 projects.

Inheritance: GraphSession
Afficher le fichier Open project: prabirshrestha/opengraph.net

Méthodes publiques

Méthode Description
GraphDesktopSession ( string applicationConfigurationName ) : System

Creates a new GraphDesktopSession with the specified configuration name.

GraphDesktopSession ( string clientID, string clientSecret ) : System

Creates a new GraphDesktopSession with the application configuration information specified.

GraphDesktopSession ( string clientID, string clientSecret, string authorizationCode, string accessToken, System.DateTime accessTokenExpiration, string refreshUrl, bool isRefreshUrlEncoded = false ) : System

Creates a new GraphDesktopSession with the application configuration information specified.

GraphDesktopSession ( string clientID, string clientSecret, string authorizationCode, string refreshUrl, bool isRefreshUrlEncoded = false ) : System

Creates a new GraphDesktopSession with the application configuration information specified.

Méthodes protégées

Méthode Description
RefreshSession ( ) : void

Method Details

GraphDesktopSession() public méthode

Creates a new GraphDesktopSession with the specified configuration name.
Thrown if is /// null or empty. Thrown if the application configuration entry with the specified /// name could not be located in the configuration file, or if the configuration file did not specify an /// OpenGraph configuration section named <OpenGraph.NET>.
public GraphDesktopSession ( string applicationConfigurationName ) : System
applicationConfigurationName string The name of the application configuration element found /// in the application or web configuration file.
Résultat System

GraphDesktopSession() public méthode

Creates a new GraphDesktopSession with the application configuration information specified.
Thrown if or /// is or empty.
public GraphDesktopSession ( string clientID, string clientSecret ) : System
clientID string The application ID, provided by Facebook.
clientSecret string The application secret, provided by Facebook.
Résultat System

GraphDesktopSession() public méthode

Creates a new GraphDesktopSession with the application configuration information specified.
public GraphDesktopSession ( string clientID, string clientSecret, string authorizationCode, string accessToken, System.DateTime accessTokenExpiration, string refreshUrl, bool isRefreshUrlEncoded = false ) : System
clientID string The application ID, provided by Facebook.
clientSecret string The application secret, provided by Facebook.
authorizationCode string The authorization code provided by an already-executed Graph API request.
accessToken string The pre-existing access token.
accessTokenExpiration System.DateTime The expiration time of the access token. If the access token does not expired (as requested with OfflineAccess, /// then this should be set to DateTime.MaxValue.
refreshUrl string The Redirect URL provided to the Graph API server when obtaining the authorization code.
isRefreshUrlEncoded bool Whether is URL-encoded.
Résultat System

GraphDesktopSession() public méthode

Creates a new GraphDesktopSession with the application configuration information specified.
Thrown if , , , /// or is or empty.
public GraphDesktopSession ( string clientID, string clientSecret, string authorizationCode, string refreshUrl, bool isRefreshUrlEncoded = false ) : System
clientID string The application ID, provided by Facebook.
clientSecret string The application secret, provided by Facebook.
authorizationCode string The authorization code provided by an already-executed Graph API request.
refreshUrl string The Redirect URL provided to the Graph API server when obtaining the authorization code.
isRefreshUrlEncoded bool Whether is URL-encoded.
Résultat System

RefreshSession() protected méthode

protected RefreshSession ( ) : void
Résultat void