LoadNotificationEventFromXml method

void LoadNotificationEventFromXml(
  1. EwsServiceXmlReader reader,
  2. String eventElementName,
  3. EventType? eventType,
  4. NotificationGroup notifications,
)
Loads a notification event from XML. The reader. Name of the event XML element. Type of the event. Collection of notifications

Implementation

/* private */
void LoadNotificationEventFromXml(
    EwsServiceXmlReader reader,
    String eventElementName,
    EventType? eventType,
    NotificationGroup notifications) {
  DateTime? timestamp = reader.ReadElementValueWithNamespace<DateTime>(
      XmlNamespace.Types, XmlElementNames.TimeStamp);

  NotificationEvent notificationEvent;

  reader.Read();

  if (reader.LocalName == XmlElementNames.FolderId) {
    notificationEvent = new FolderEvent(eventType, timestamp);
  } else {
    notificationEvent = new ItemEvent(eventType, timestamp);
  }

  notificationEvent.LoadFromXml(reader, eventElementName);
  notifications.Events.add(notificationEvent);
}