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

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

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

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

            return(response == null ? true : response.TypedValue);
        }
コード例 #2
0
        private bool BanUsers(List<long> uids, bool isAsync, BanUsersCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.admin.banUsers" } };
            Utilities.AddJSONArray(parameterList, "uids", uids);

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

            var response = SendRequest<admin_banUsers_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
コード例 #3
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Prevents users from accessing an application's canvas page and its forums.
 /// </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.BanUsersAsync(uids, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(string result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uids">A List of user IDs to ban.</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 banned.</returns>
 public void BanUsersAsync(List <long> uids, BanUsersCallback callback, Object state)
 {
     BanUsers(uids, true, callback, state);
 }
コード例 #4
0
 /// <summary>
 /// Prevents users from accessing an application's canvas page and its forums.
 /// </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.BanUsersAsync(uids, AsyncDemoCompleted, null);
 /// }
 /// 
 /// private static void AsyncDemoCompleted(string result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uids">A List of user IDs to ban.</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 banned.</returns>
 public void BanUsersAsync(List<long> uids, BanUsersCallback callback, Object state)
 {
     BanUsers(uids, true, callback, state);
 }