コード例 #1
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
        private bool SetRestrictionInfo(Dictionary <string, string> restrictionDictionary, bool isAsync, SetRestrictionInfoCallback callback, Object state)
        {
            string restriction   = JSONHelper.ConvertToJSONAssociativeArray(restrictionDictionary);
            var    parameterList = new Dictionary <string, string> {
                { "method", "facebook.admin.setRestrictionInfo" }
            };

            Utilities.AddOptionalParameter(parameterList, "restriction_str", restriction);

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

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

            return(response == null ? true : response.TypedValue);
        }
コード例 #2
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Sets 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;
 ///     Dictionary&lt;string, string&gt; restrictions = new Dictionary&lt;string, string&gt; { { "age_distribution", "10-99" } };
 ///     api.Admin.SetRestrictionInfoAsync(restrictions, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     bool actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="restriction">A Dictionary of the restricting attributes. Restrictions include age, location, age_distribution, and type.</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 restrictions are successfully set.</returns>
 public void SetRestrictionInfoAsync(Dictionary <string, string> restriction, SetRestrictionInfoCallback callback, Object state)
 {
     SetRestrictionInfo(restriction, true, callback, state);
 }
コード例 #3
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Sets 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.SetRestrictionInfoAsync(AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     bool 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 true if the restrictions are successfully set.</returns>
 public void SetRestrictionInfoAsync(SetRestrictionInfoCallback callback, Object state)
 {
     SetRestrictionInfoAsync(null, callback, state);
 }
コード例 #4
0
        private bool SetRestrictionInfo(Dictionary<string, string> restrictionDictionary, bool isAsync, SetRestrictionInfoCallback callback, Object state)
        {
            string restriction = JSONHelper.ConvertToJSONAssociativeArray(restrictionDictionary);
            var parameterList = new Dictionary<string, string> { { "method", "facebook.admin.setRestrictionInfo" } };
            Utilities.AddOptionalParameter(parameterList, "restriction_str", restriction);

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

            var response = SendRequest<admin_setRestrictionInfo_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
コード例 #5
0
 /// <summary>
 /// Sets 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;
 ///     Dictionary&lt;string, string&gt; restrictions = new Dictionary&lt;string, string&gt; { { "age_distribution", "10-99" } };
 ///     api.Admin.SetRestrictionInfoAsync(restrictions, AsyncDemoCompleted, null);
 /// }
 /// 
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     bool actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="restriction">A Dictionary of the restricting attributes. Restrictions include age, location, age_distribution, and type.</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 restrictions are successfully set.</returns>
 public void SetRestrictionInfoAsync(Dictionary<string, string> restriction, SetRestrictionInfoCallback callback, Object state)
 {
     SetRestrictionInfo(restriction, true, callback, state);
 }
コード例 #6
0
 /// <summary>
 /// Sets 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.SetRestrictionInfoAsync(AsyncDemoCompleted, null);
 /// }
 /// 
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     bool 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 true if the restrictions are successfully set.</returns>
 public void SetRestrictionInfoAsync(SetRestrictionInfoCallback callback, Object state)
 {
     SetRestrictionInfoAsync(null, callback, state);
 }