LoadFromXml method

  1. @override
Future<void> LoadFromXml(
  1. EwsServiceXmlReader reader,
  2. String? localElementName
)
override
Loads from XML. The reader. Name of the local element.

Implementation

@override
Future<void> LoadFromXml(
    EwsServiceXmlReader reader, String? localElementName) async {
  reader.EnsureCurrentNodeIsStartElementWithNamespace(
      XmlNamespace.Types, localElementName);

  await reader.ReadStartElementWithNamespace(
      XmlNamespace.Types, this.InnerCollectionXmlElementName);
  await super.LoadFromXml(reader, this.InnerCollectionXmlElementName);
  await reader.ReadEndElementIfNecessary(
      XmlNamespace.Types, this.InnerCollectionXmlElementName);

  await reader.Read();

  if (reader.IsStartElementWithNamespace(
      XmlNamespace.Types, XmlElementNames.UnknownEntries)) {
    do {
      await reader.Read();

      if (reader.IsStartElementWithNamespace(
          XmlNamespace.Types, XmlElementNames.UnknownEntry)) {
        this._unknownEntries.add(await reader.ReadElementValue<String>());
      }
    } while (!reader.IsEndElementWithNamespace(
        XmlNamespace.Types, XmlElementNames.UnknownEntries));
  }
}