LoadFromXml method

Future<void> LoadFromXml(
  1. EwsXmlReader reader
)
Loads the settings from XML. The reader.

Implementation

Future<void> LoadFromXml(EwsXmlReader reader) async {
  await reader.ReadStartElementWithNamespace(
      XmlNamespace.NotSpecified, XmlElementNames.Autodiscover);
  await reader.ReadStartElementWithNamespace(
      XmlNamespace.NotSpecified, XmlElementNames.Response);

  do {
    await reader.Read();

    if (reader.IsStartElement()) {
      if (!await this.TryReadCurrentXmlElement(reader)) {
        await reader.SkipCurrentElement();
      }
    }
  } while (!reader.IsEndElementWithNamespace(
      XmlNamespace.NotSpecified, XmlElementNames.Response));

  await reader.ReadEndElementWithNamespace(
      XmlNamespace.NotSpecified, XmlElementNames.Autodiscover);
}