private bool IsAdmin(long page_id, bool isAsync, IsAdminCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.pages.isAdmin" } }; Utilities.AddRequiredParameter(parameterList, "page_id", page_id); if (isAsync) { SendRequestAsync <pages_isAdmin_response, bool>(parameterList, new FacebookCallCompleted <bool>(callback), state); return(true); } var response = SendRequest <pages_isAdmin_response>(parameterList); return(response == null ? true : response.TypedValue); }
private bool IsAdmin(long page_id, bool isAsync, IsAdminCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.pages.isAdmin" } }; Utilities.AddRequiredParameter(parameterList, "page_id", page_id); if (isAsync) { SendRequestAsync<pages_isAdmin_response, bool>(parameterList, new FacebookCallCompleted<bool>(callback), state); return true; } var response = SendRequest<pages_isAdmin_response>(parameterList); return response == null ? true : response.TypedValue; }
/// <summary> /// Checks whether the logged-in user is the admin for a given Page. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// api.Pages.IsAdminAsync(Constants.PageId, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="page_id">The ID of the Facebook Page.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>Returns true or false.</returns> public void IsAdminAsync(long page_id, IsAdminCallback callback, Object state) { IsAdmin(page_id, true, callback, state); }