LoadDomainSettingsFromXml method

Future<void> LoadDomainSettingsFromXml(
  1. EwsXmlReader reader
)
Loads from XML. The reader.

Implementation

Future<void> LoadDomainSettingsFromXml(EwsXmlReader reader) async {
  if (!reader.IsEmptyElement) {
    do {
      await reader.Read();

      if ((reader.NodeType == XmlNodeType.Element) &&
          (reader.LocalName == XmlElementNames.DomainSetting)) {
        String? settingClass = reader.ReadAttributeValueWithNamespace(
            XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);

        switch (settingClass) {
          case XmlElementNames.DomainStringSetting:
            await this.ReadSettingFromXml(reader);
            break;

          default:
            EwsUtilities.Assert(
                false,
                "GetDomainSettingsResponse.LoadDomainSettingsFromXml",
                "Invalid setting class '$settingClass' returned");
            break;
        }
      }
    } while (!reader.IsEndElementWithNamespace(
        XmlNamespace.Autodiscover, XmlElementNames.DomainSettings));
  }
}