Guest User

Untitled

a guest
Feb 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. public Event UpdateRecurrentEvents(Event calendarEvent)
  2. {
  3. Appointment recurringMaster = null;
  4.  
  5. // Get the Appoinment by Id
  6. Appointment appointment = FindItem(calendarEvent.EventId.UniqueId);
  7. var properties = GetLoadProperties(CalendarEventLightweightType.None);
  8. appointment.Load(properties);
  9. if (appointment == null)
  10. {
  11. throw new ResourceNotFoundException("Exchange: Appointment was not found in the organizer's calendar.");
  12. }
  13.  
  14. // the code is the same like in the link
  15.  
  16. // Update the series.
  17. try
  18. {
  19. // This method results in a call to EWS.
  20. recurringMaster.Update(ConflictResolutionMode.AutoResolve,
  21. meeting == null
  22. ? SendInvitationsOrCancellationsMode.SendToNone
  23. : SendInvitationsOrCancellationsMode.SendToAllAndSaveCopy);
  24.  
  25. properties = GetLoadProperties(CalendarEventLightweightType.None);
  26. recurringMaster.Load(properties);
  27.  
  28. recurringMaster.TryGetProperty(extendedPlainTextBody, out plainTextBody);
  29. }
  30. catch (Exception ex)
  31. {
  32. Log.ErrorFormat("Exchange service error: {0}.", ex.Message);
  33. throw new GatewayServiceException("Exchange service error", ex);
  34. }
  35.  
  36. return //custom mapper
  37. }
  38.  
  39. at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
  40. at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
  41. at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalUpdateItems(IEnumerable`1 items, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode, ServiceErrorHandling errorHandling, Boolean suppressReadReceipt)
  42. at Microsoft.Exchange.WebServices.Data.ExchangeService.UpdateItem(Item item, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode, Boolean suppressReadReceipts)
  43. at Microsoft.Exchange.WebServices.Data.Item.InternalUpdate(FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode, Boolean suppressReadReceipts)
  44. at Microsoft.Exchange.WebServices.Data.Item.Update(ConflictResolutionMode conflictResolutionMode, Boolean suppressReadReceipts)
  45. at Microsoft.Exchange.WebServices.Data.Item.Update(ConflictResolutionMode conflictResolutionMode)
Add Comment
Please, Sign In to add comment