Ejemplo n.º 1
0
        private bool RevokeExtendedPermission(Enums.ExtendedPermissions ext_perm, long uid, bool isAsync, RevokeExtendedPermissionCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.auth.revokeExtendedPermission" }
            };

            Utilities.AddRequiredParameter(parameterList, "perm", ext_perm.ToString());
            Utilities.AddOptionalParameter(parameterList, "uid", uid);

            if (isAsync)
            {
                SendRequestAsync <auth_revokeExtendedPermission_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state);
                return(true);
            }

            var response = SendRequest <auth_revokeExtendedPermission_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));

            return(response == null ? true : response.TypedValue);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Begins an async request to to revoke extended permission. See the facebook
 /// guide for more information
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Auth.RevokeExtendedPermissionAsync(Enums.ExtendedPermissions.create_event, Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="ext_perm">The extended permission to revoke.</param>
 /// <param name="uid">The user ID of the user whose extended permission you want to revoke. If you don't specify this parameter, then you must have a valid session for the current user, and that session's user will have the specified permission revoked.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns true upon success.</returns>
 public void RevokeExtendedPermissionAsync(Enums.ExtendedPermissions ext_perm, long uid, RevokeExtendedPermissionCallback callback, Object state)
 {
     RevokeExtendedPermission(ext_perm, uid, true, callback, state);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes a specific extended permission that a user explicitly granted to 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.RevokeExtendedPermissionAsync(Enums.ExtendedPermissions.create_event, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="ext_perm">The extended permission to revoke.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns true upon success.</returns>
 public void RevokeExtendedPermissionAsync(Enums.ExtendedPermissions ext_perm, RevokeExtendedPermissionCallback callback, Object state)
 {
     RevokeExtendedPermissionAsync(ext_perm, -1, callback, state);
 }
        private bool RevokeExtendedPermission(Enums.ExtendedPermissions ext_perm, long uid, bool isAsync, RevokeExtendedPermissionCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.auth.revokeExtendedPermission" } };
            Utilities.AddRequiredParameter(parameterList, "perm", ext_perm.ToString());
            Utilities.AddOptionalParameter(parameterList, "uid", uid);

            if (isAsync)
            {
                SendRequestAsync<auth_revokeExtendedPermission_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state);
                return true;
            }

            var response = SendRequest<auth_revokeExtendedPermission_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
 /// <summary>
 /// Begins an async request to to revoke extended permission. See the facebook 
 /// guide for more information
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Auth.RevokeExtendedPermissionAsync(Enums.ExtendedPermissions.create_event, Constants.UserId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="ext_perm">The extended permission to revoke.</param>
 /// <param name="uid">The user ID of the user whose extended permission you want to revoke. If you don't specify this parameter, then you must have a valid session for the current user, and that session's user will have the specified permission revoked.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>This method returns true upon success.</returns>
 public void RevokeExtendedPermissionAsync(Enums.ExtendedPermissions ext_perm, long uid, RevokeExtendedPermissionCallback callback, Object state)
 {
     RevokeExtendedPermission(ext_perm, uid, true, callback, state);
 }
 /// <summary>
 /// Removes a specific extended permission that a user explicitly granted to 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.RevokeExtendedPermissionAsync(Enums.ExtendedPermissions.create_event, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="ext_perm">The extended permission to revoke.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns true upon success.</returns>
 public void RevokeExtendedPermissionAsync(Enums.ExtendedPermissions ext_perm, RevokeExtendedPermissionCallback callback, Object state)
 {
     RevokeExtendedPermissionAsync(ext_perm, -1, callback, state);
 }