コード例 #1
0
        private void SetUserPreference(int pref_id, string value, bool isAsync, SetUserPreferenceCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.data.setUserPreference" } };
            Utilities.AddRequiredParameter(parameterList, "pref_id", pref_id);
            Utilities.AddRequiredParameter(parameterList, "value", value);

            if (isAsync)
            {
                SendRequestAsync<data_setUserPreference_response, bool>(parameterList, new FacebookCallCompleted<bool>(callback), state);
                return;
            }

            SendRequest(parameterList);
        }
コード例 #2
0
 /// <summary>
 /// Sets currently authenticated user's preference.
 /// </summary>
 /// <example>
 /// <code>
 /// 
 /// </code>
 /// </example>
 /// <param name="pref_id">(0-201) Numeric identifier of this preference.</param>
 /// <param name="value">(max. 128 characters) Value of the preference to set. Set it to "0" or "" to remove this preference.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <remarks>
 /// Each preference is a string of maximum 128 characters and each of them has a numeric identifier ranged from 0 to 200. Therefore, every application can store up to 201 string values for each of its user.  
 /// To "remove" a preference, set it to 0 or empty string. Both "0" and "" are considered as "not present", and getPreference() call will not return them. To tell them from each other, one can use some serialization format. For example, "n:0" for zeros and "s:" for empty strings. 
 /// </remarks>
 public void SetUserPreferenceAsync(int pref_id, string value, SetUserPreferenceCallback callback, Object state)
 {
     SetUserPreference(pref_id, value, true, callback, state);
 }