Exemple #1
0
        private string GetRestrictionInfo(bool isAsync, GetRestrictionInfoCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.admin.getRestrictionInfo" }
            };

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

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

            return(response == null ? null : response.TypedValue);
        }
        private string GetRestrictionInfo(bool isAsync, GetRestrictionInfoCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.admin.getRestrictionInfo" } };

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

            var response = SendRequest<admin_getRestrictionInfo_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? null : response.TypedValue;
        }
Exemple #3
0
 /// <summary>
 /// Returns the demographic restrictions for the application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     api.Admin.GetRestrictionInfoAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(string result, Object state, FacebookException e)
 /// {
 ///     string actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns a string containing the demographic restrictions for the application.</returns>
 public void GetRestrictionInfoAsync(GetRestrictionInfoCallback callback, Object state)
 {
     GetRestrictionInfo(true, callback, state);
 }
 /// <summary>
 /// Returns the demographic restrictions for the application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     api.Admin.GetRestrictionInfoAsync(AsyncDemoCompleted, null);
 /// }
 /// 
 /// private static void AsyncDemoCompleted(string result, Object state, FacebookException e)
 /// {
 ///     string actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>This method returns a string containing the demographic restrictions for the application.</returns>
 public void GetRestrictionInfoAsync(GetRestrictionInfoCallback callback, Object state)
 {
     GetRestrictionInfo(true, callback, state);
 }