LoadNotificationEventFromXml method

Future<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 */
Future<void> LoadNotificationEventFromXml(
    EwsServiceXmlReader reader,
    String eventElementName,
    EventType? eventType,
    NotificationGroup notifications) async {
  DateTime? timestamp = await reader.ReadElementValueWithNamespace<DateTime>(
      XmlNamespace.Types, XmlElementNames.TimeStamp);

  NotificationEvent notificationEvent;

  await reader.Read();

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

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