Ejemplo n.º 1
0
        /// <summary>
        /// Initialize a new service instance from the specified OAuth client.
        /// </summary>
        /// <param name="client">The OAuth client.</param>
        public static FacebookService CreateFromOAuthClient(FacebookOAuthClient client) {

            // This should never be null
            if (client == null) throw new ArgumentNullException("client");

            // Initialize the service
            FacebookService service = new FacebookService {
                Client = client
            };

            // Set the endpoints etc.
            service.Methods = new FacebookMethodsEndpoint(service);

            // Return the service
            return service;
        
        }
        /// <summary>
        /// Initialize a new service instance from the specified OAuth client.
        /// </summary>
        /// <param name="client">The OAuth client.</param>
        public static FacebookService CreateFromOAuthClient(FacebookOAuthClient client)
        {
            // This should never be null
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            // Initialize the service
            FacebookService service = new FacebookService {
                Client = client
            };

            // Set the endpoints etc.
            service.Methods = new FacebookMethodsEndpoint(service);

            // Return the service
            return(service);
        }
 /// <summary>
 /// Initializes a new instance of the FacebookService class. Invoking this method will not
 /// result in any calls to the Facebook API.
 /// </summary>
 public FacebookService GetService() {
     return _service ?? (_service = FacebookService.CreateFromAccessToken(AccessToken));
 }