Esempio n. 1
0
        private bool ExpireSession(bool isAsync, ExpireSessionCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.auth.expireSession" }
            };

            if (isAsync)
            {
                SendRequestAsync <auth_expireSession_response, bool>(parameterList, new FacebookCallCompleted <bool>(callback), state);
                return(true);
            }

            var response = SendRequest <auth_expireSession_response>(parameterList);

            return(response == null ? true : response.TypedValue);
        }
        private bool ExpireSession(bool isAsync, ExpireSessionCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.auth.expireSession" } };

            if (isAsync)
            {
                SendRequestAsync<auth_expireSession_response, bool>(parameterList, new FacebookCallCompleted<bool>(callback), state);
                return true;
            }

            var response = SendRequest<auth_expireSession_response>(parameterList);
            return response == null ? true : response.TypedValue;
        }
Esempio n. 3
0
 /// <summary>
 /// Expires the session indicated in the API call, for your application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Auth.ExpireSessionAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>If the invalidation is successful, this will return true.</returns>
 public void ExpireSessionAsync(ExpireSessionCallback callback, Object state)
 {
     ExpireSession(true, callback, state);
 }
 /// <summary>
 /// Expires the session indicated in the API call, for your application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Auth.ExpireSessionAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>If the invalidation is successful, this will return true.</returns>
 public void ExpireSessionAsync(ExpireSessionCallback callback, Object state)
 {
     ExpireSession(true, callback, state);
 }