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); }
/// <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<long> uids = new List<long> { 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); }
/// <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<long> uids = new List<long> { 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); }
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; }