private void SetAssociation(string name, long obj_id1, long obj_id2, string data, DateTime assoc_time, bool isAsync, SetAssociationCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.data.setAssociation" } }; Utilities.AddRequiredParameter(parameterList, "name", name); Utilities.AddRequiredParameter(parameterList, "obj_id1", obj_id1); Utilities.AddRequiredParameter(parameterList, "obj_id2", obj_id2); Utilities.AddRequiredParameter(parameterList, "data", data); Utilities.AddRequiredParameter(parameterList, "assoc_time", (double)DateHelper.ConvertDateToDouble(DateTime.Now)); if (isAsync) { SendRequestAsync<data_setAssociation_response, bool>(parameterList, new FacebookCallCompleted<bool>(callback), state); return; } SendRequest(parameterList); }
/// <summary> /// Creates an association between two object identifiers. The order of these two identifiers matters, unless this is a symmetric two-way association. /// </summary> /// <example> /// <code> /// /// </code> /// </example> /// <param name="name">Name of the association to set. </param> /// <param name="obj_id1">Object identifier 1. </param> /// <param name="obj_id2">Object identifier 2. </param> /// <param name="data">Optional - An arbitrary data (max. 255 characters) to store with this association. </param> /// <param name="assoc_time">Optional - Default to association creation time. A timestamp to store with this association. This timestamp is represented as number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). </param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> public void SetAssociationAsync(string name, long obj_id1, long obj_id2, string data, DateTime assoc_time, SetAssociationCallback callback, Object state) { SetAssociation(name, obj_id1, obj_id2, data, assoc_time, true, callback, state); }