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

            Utilities.AddJSONAssociativeArray(parameterList, "properties", properties);

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

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

            return(response == null ? true : response.TypedValue);
        }
コード例 #2
0
        private bool SetAppProperties(Dictionary<string, string> properties, bool isAsync, SetAppPropertiesCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.admin.setAppProperties" } };
            Utilities.AddJSONAssociativeArray(parameterList, "properties", properties);

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

            var response = SendRequest<admin_setAppProperties_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));
            return response == null ? true : response.TypedValue;
        }
コード例 #3
0
ファイル: Admin.cs プロジェクト: lsmolic/hangoutsrc
 /// <summary>
 /// Sets values for properties for your applications in the Facebook Developer application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunWebDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     Dictionary&lt;string, string&gt; properties = new Dictionary&lt;string, string&gt; { { "privacy_url", "http://localhost/" } };
 ///     api.Admin.SetAppPropertiesAsync(properties, AsyncWebDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncWebDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     bool actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="properties">A Dictionary of property names to new values. This call will fail if values have the wrong 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 set is successful.</returns>
 public void SetAppPropertiesAsync(Dictionary <string, string> properties, SetAppPropertiesCallback callback, Object state)
 {
     SetAppProperties(properties, true, callback, state);
 }
コード例 #4
0
 /// <summary>
 /// Sets values for properties for your applications in the Facebook Developer application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunWebDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     Dictionary&lt;string, string&gt; properties = new Dictionary&lt;string, string&gt; { { "privacy_url", "http://localhost/" } };
 ///     api.Admin.SetAppPropertiesAsync(properties, AsyncWebDemoCompleted, null);
 /// }
 /// 
 /// private static void AsyncWebDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     bool actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="properties">A Dictionary of property names to new values. This call will fail if values have the wrong 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 set is successful.</returns>
 public void SetAppPropertiesAsync(Dictionary<string, string> properties, SetAppPropertiesCallback callback, Object state)
 {
     SetAppProperties(properties, true, callback, state);
 }