コード例 #1
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
        private bool UnbanUsers(List <long> uids, bool isAsync, UnBanUsersCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.admin.unbanUsers" }
            };

            Utilities.AddJSONArray(parameterList, "uids", uids);

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

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

            return(response == null ? true : response.TypedValue);
        }
コード例 #2
0
 /// <summary>
 /// Unbans users previously banned with admin.banUsers.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///    Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///    api.Session.UserId = Constants.UserId;
 ///    List&lt;long&gt; uids = new List&lt;long&gt; { 1000001, 1000002 };
 ///    api.Admin.UnbanUsersAsync(uids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///    var actual = result;
 ///}
 /// </code>
 /// </example>
 /// <param name="uids">A List of user IDs to unban.</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 if the users were successfully unbanned.</returns>
 public void UnbanUsersAsync(List<long> uids, UnBanUsersCallback callback, Object state)
 {
     UnbanUsers(uids, true, callback, state);
 }
コード例 #3
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Unbans users previously banned with admin.banUsers.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///    Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///    api.Session.UserId = Constants.UserId;
 ///    List&lt;long&gt; uids = new List&lt;long&gt; { 1000001, 1000002 };
 ///    api.Admin.UnbanUsersAsync(uids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///    var actual = result;
 ///}
 /// </code>
 /// </example>
 /// <param name="uids">A List of user IDs to unban.</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 if the users were successfully unbanned.</returns>
 public void UnbanUsersAsync(List <long> uids, UnBanUsersCallback callback, Object state)
 {
     UnbanUsers(uids, true, callback, state);
 }
コード例 #4
0
        private bool UnbanUsers(List<long> uids, bool isAsync, UnBanUsersCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.admin.unbanUsers" } };
            Utilities.AddJSONArray(parameterList, "uids", uids);

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

            var response = SendRequest<admin_unbanUsers_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }