コード例 #1
0
        private string GetHashValue(string obj_type, string key, string prop_name, bool isAsync, GetHashValueCallback callback, Object state)
        {
            var parameterList = new Dictionary<string, string> { { "method", "facebook.data.getHashValue" } };
            Utilities.AddRequiredParameter(parameterList, "obj_type", obj_type);
            Utilities.AddRequiredParameter(parameterList, "key", key);
            Utilities.AddRequiredParameter(parameterList, "prop_name", prop_name);

            if (isAsync)
            {
                SendRequestAsync<data_getHashValue_response, string>(parameterList, new FacebookCallCompleted<string>(callback), state);
                return null;
            }

            var response = SendRequest<data_getHashValue_response>(parameterList);
            return response == null ? null : response.TypedValue;
        }
コード例 #2
0
 /// <summary>
 /// Get a property value by a hash key. 
 /// </summary>
 /// <example>
 /// <code>
 /// 
 /// </code>
 /// </example>
 /// <param name="obj_type">Object's type. This is required, so that different object types may use the same hash keys for different objects. </param>
 /// <param name="key">Hash key (string object identifier) for locating the object. This is created by a call to Data.setHashValue. </param>
 /// <param name="prop_name">Name of the property to query. </param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>        
 /// <returns>string: property's value. Empty string will be returned (without any error), if object with the specified hash key was not found or created. </returns>
 public string GetHashValueAsync(string obj_type, string key, string prop_name, GetHashValueCallback callback, Object state)
 {
     return GetHashValue(obj_type, key, prop_name, true, callback, state);
 }