ReadSettingFromXml method

Future<void> ReadSettingFromXml(
  1. EwsXmlReader reader
)
Reads domain setting from XML. The reader.

Implementation

/* private */
Future<void> ReadSettingFromXml(EwsXmlReader reader) async {
  DomainSettingName? name = null;
  Object? value = null;

  do {
    await reader.Read();

    if (reader.NodeType == XmlNodeType.Element) {
      switch (reader.LocalName) {
        case XmlElementNames.Name:
          name = await reader.ReadElementValue<DomainSettingName>();
          break;
        case XmlElementNames.Value:
          value = await reader.ReadElementValue<String>();
          break;
      }
    }
  } while (!reader.IsEndElementWithNamespace(
      XmlNamespace.Autodiscover, XmlElementNames.DomainSetting));

  EwsUtilities.Assert(
      name != null,
      "GetDomainSettingsResponse.ReadSettingFromXml",
      "Missing name element in domain setting");

  this._settings![name] = value;
}