LoadFromXmlWithNamespace method

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

Implementation

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

  if (!reader.IsEmptyElement) {
    do {
      await reader.Read();

      if (reader.IsStartElement()) {
        TComplexProperty? complexProperty =
            this.CreateComplexProperty(reader.LocalName);

        if (complexProperty != null) {
          await complexProperty.LoadFromXml(reader, reader.LocalName);
          this.InternalAdd(complexProperty, true);
        } else {
          await reader.SkipCurrentElement();
        }
      }
    } while (
        !reader.IsEndElementWithNamespace(xmlNamespace, localElementName));
  }
}