/// <summary> /// Deletes this timeline from the API. /// </summary> public Task DeleteAsync(ITimelineService api) { return(api.PutJsonAsync("Timeline/Delete", new { TimelineId = Id, })); }
/// <summary> /// Deletes the event with the specified ID from the API. /// </summary> public static Task DeleteAsync(ITimelineService api, string timelineEventId) { return(api.PutJsonAsync("TimelineEvent/Delete", new { TimelineEventId = timelineEventId })); }
/// <summary> /// Unlinks the event with the ID from the timeline with the specified ID. /// </summary> public static Task UnlinkEventAsync(ITimelineService api, string timelineId, string timelineEventId) { return(api.PutJsonAsync("Timeline/UnlinkEvent", new { TimelineId = timelineId, EventId = timelineEventId })); }
/// <summary> /// Saves a change to the event datetime of the event to the API. /// </summary> public Task EditEventDateTimeAsync(ITimelineService api) { return(api.PutJsonAsync("TimelineEvent/EditEventDateTime", new { TimelineEventId = Id, EventDateTime = EventDateTime.Ticks.ToString() })); }
/// <summary> /// Saves a change to the location of the event to the API. /// </summary> public Task EditLocationAsync(ITimelineService api) { return(api.PutJsonAsync("TimelineEvent/EditLocation", new { TimelineEventId = Id, Location })); }
/// <summary> /// Saves a change to the title of the event to the API. /// </summary> public Task EditTitleAsync(ITimelineService api) { return(api.PutJsonAsync("TimelineEvent/EditTitle", new { TimelineEventId = Id, Title })); }
/// <summary> /// Creates a new timeline with the title. /// </summary> public static async Task <Timeline> CreateAsync(ITimelineService api, string title) { string json = await api.PutJsonAsync("Timeline/Create", new { TimelineId = Guid.NewGuid().ToString(), Title = title }); return(JsonConvert.DeserializeObject <Timeline>(json)); }
/// <summary> /// Creates a new attachment on the API for the specified timeline ID. /// </summary> public static async Task <Attachment> CreateAsync(ITimelineService api, string timelineEventId, string title) { string json = await api.PutJsonAsync("TimelineEventAttachment/Create", new { AttachmentId = Guid.NewGuid().ToString(), TimelineEventId = timelineEventId, Title = title }); return(JsonConvert.DeserializeObject <Attachment>(json)); }
/// <summary> /// Creates a new event not linked to any timeline. /// </summary> private static async Task <TimelineEvent> CreateAsync(ITimelineService api, string id, string title, string description, DateTime eventDateTime, string location) { string json = await api.PutJsonAsync("TimelineEvent/Create", new { TimelineEventId = id, Title = title, Description = description, EventDateTime = eventDateTime.Ticks.ToString(), Location = location }); return(JsonConvert.DeserializeObject <TimelineEvent>(json)); }
/// <summary> /// Deletes the attachment from the API. /// </summary> /// <param name="api"></param> /// <returns></returns> public async Task DeleteAsync(ITimelineService api) { await api.PutJsonAsync("TimelineEventAttachment/Delete", new { AttachmentId = Id }); // Delete attachment from disk if it's there. var file = Path.Combine(api.CacheFolder, Name); if (api.FileExists(file)) { api.FileDelete(file); } }