private bool Edit(long eid, facebookevent event_info, bool isAsync, EditEventCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.events.edit" } }; Utilities.AddRequiredParameter(parameterList, "eid", eid); var dict = new Dictionary <string, string> { { "description", event_info.description }, { "end_time", event_info.end_time.ToString() }, { "category", event_info.event_type }, { "subcategory", event_info.event_subtype }, { "host", event_info.host }, { "location", event_info.location }, { "name", event_info.name }, { "start_time", event_info.start_time.ToString() }, { "tagline", event_info.tagline } }; Utilities.AddJSONAssociativeArray(parameterList, "event_info", dict); if (isAsync) { SendRequestAsync <events_edit_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state); return(true); } var response = SendRequest <events_edit_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return(response == null ? false : response.TypedValue); }
private bool Edit(long eid, facebookevent event_info, bool isAsync, EditEventCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.events.edit" } }; Utilities.AddRequiredParameter(parameterList, "eid", eid); var dict = new Dictionary<string, string> { {"description", event_info.description}, {"end_time", event_info.end_time.ToString()}, {"category", event_info.event_type}, {"subcategory", event_info.event_subtype}, {"host", event_info.host}, {"location", event_info.location}, {"name", event_info.name}, {"start_time", event_info.start_time.ToString()}, {"tagline", event_info.tagline} }; Utilities.AddJSONAssociativeArray(parameterList, "event_info", dict); if (isAsync) { SendRequestAsync<events_edit_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state); return true; } var response = SendRequest<events_edit_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return response == null ? false : response.TypedValue; }
/// <summary> /// Edits an existing event. The application must be an admin of the event. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// facebookevent eventInfo = new facebookevent /// { /// description = "event description 2", /// end_date = DateTime.Now.AddDays(7), /// event_subtype = "1", /// event_type = "1", /// location = "location", /// venue = new location { city = "chicago" }, /// start_date = DateTime.Now.AddDays(1), /// host = "Facebook Samples", /// name = "test event" /// }; /// api.Events.EditAsync(Constants.EventId, eventInfo, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="eid">The event ID.</param> /// <param name="eventInfo">The event information. See the Facebook API Notes for information on what parameters to include in the object.</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 successful, or an error code otherwise.</returns> public void EditAsync(long eid, facebookevent eventInfo, EditEventCallback callback, Object state) { Edit(eid, eventInfo, true, callback, state); }
/// <summary> /// Edits an existing event. The application must be an admin of the event. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// facebookevent eventInfo = new facebookevent /// { /// description = "event description 2", /// end_date = DateTime.Now.AddDays(7), /// event_subtype = "1", /// event_type = "1", /// location = "location", /// venue = new location { city = "chicago" }, /// start_date = DateTime.Now.AddDays(1), /// host = "Facebook Samples", /// name = "test event" /// }; /// api.Events.EditAsync(Constants.EventId, eventInfo, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="eid">The event ID.</param> /// <param name="eventInfo">The event information. See the Facebook API Notes for information on what parameters to include in the object.</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 successful, or an error code otherwise.</returns> public void EditAsync(long eid, facebookevent eventInfo, EditEventCallback callback, Object state) { Edit(eid, eventInfo, true, callback, state); }