LoadFromXml method
Loads from XML.
The reader.
Implementation
Future<void> LoadFromXml(EwsServiceXmlReader reader) async {
await reader.ReadStartElementWithNamespace(
XmlNamespace.Messages, XmlElementNames.Notification);
this._subscriptionId = await reader.ReadElementValueWithNamespace(
XmlNamespace.Types, XmlElementNames.SubscriptionId);
this._previousWatermark = await reader.ReadElementValueWithNamespace(
XmlNamespace.Types, XmlElementNames.PreviousWatermark);
this._moreEventsAvailable =
await reader.ReadElementValueWithNamespace<bool>(
XmlNamespace.Types, XmlElementNames.MoreEvents);
do {
await reader.Read();
if (reader.IsStartElement()) {
String eventElementName = reader.LocalName;
if (_xmlElementNameToEventTypeMap.Member!
.containsKey(eventElementName)) {
EventType? eventType =
_xmlElementNameToEventTypeMap.Member![eventElementName];
this._newWatermark = await reader.ReadElementValueWithNamespace(
XmlNamespace.Types, XmlElementNames.Watermark);
if (eventType == EventType.Status) {
// We don't need to return status events
await reader.ReadEndElementIfNecessary(
XmlNamespace.Types, eventElementName);
} else {
await this._LoadNotificationEventFromXml(
reader, eventElementName, eventType);
}
} else {
await reader.SkipCurrentElement();
}
}
} while (!reader.IsEndElementWithNamespace(
XmlNamespace.Messages, XmlElementNames.Notification));
}