/// <summary> /// Called when client application deletes this file. /// </summary> /// <param name="multistatus">Error description if case delate failed. Ignored by most clients.</param> public override async Task DeleteAsync(MultistatusException multistatus) { // Notify attendees that event is canceled if deletion is successful. string calendarObjectContent = File.ReadAllText(fileSystemInfo.FullName); await base.DeleteAsync(multistatus); IEnumerable <IComponent> calendars = new vFormatter().Deserialize(calendarObjectContent); ICalendar2 calendar = calendars.First() as ICalendar2; calendar.Method = calendar.CreateMethodProp(MethodType.Cancel); await iMipEventSchedulingTransport.NotifyAttendeesAsync(context, calendar); }
/// <summary> /// Called when event or to-do is being saved to back-end storage. /// </summary> /// <param name="stream">Stream containing VCALENDAR, typically with a single VEVENT ot VTODO component.</param> /// <param name="contentType">Content type.</param> /// <param name="startIndex">Starting byte in target file /// for which data comes in <paramref name="content"/> stream.</param> /// <param name="totalFileSize">Size of file as it will be after all parts are uploaded. -1 if unknown (in case of chunked upload).</param> /// <returns>Whether the whole stream has been written.</returns> public override async Task <bool> WriteAsync(Stream content, string contentType, long startIndex, long totalFileSize) { bool result = await base.WriteAsync(content, contentType, startIndex, totalFileSize); // Notify attendees that event is created or modified. string calendarObjectContent = File.ReadAllText(fileSystemInfo.FullName); IEnumerable <IComponent> calendars = new vFormatter().Deserialize(calendarObjectContent); ICalendar2 calendar = calendars.First() as ICalendar2; calendar.Method = calendar.CreateMethodProp(MethodType.Request); await iMipEventSchedulingTransport.NotifyAttendeesAsync(context, calendar); return(result); }