LoadFromXml method

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

Implementation

Future<void> LoadFromXml(EwsXmlReader reader) async {
  do {
    await reader.Read();

    if (reader.NodeType == XmlNodeType.Element) {
      switch (reader.LocalName) {
        case XmlElementNames.Type:
          this.ProtocolType = OutlookProtocol.ProtocolNameToType(
              await reader.ReadElementValue<String>());
          break;
        case XmlElementNames.AuthPackage:
          this.authPackage = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.Server:
          this.server = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.ServerDN:
          this.serverDN = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.ServerVersion:
          // just read it out
          await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.AD:
          this.activeDirectoryServer =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.MdbDN:
          this.mailboxDN = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EWSUrl:
          this.exchangeWebServicesUrl =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EmwsUrl:
          this.exchangeManagementWebServicesUrl =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.ASUrl:
          this.availabilityServiceUrl =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.OOFUrl:
          // just read it out
          await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.UMUrl:
          this.unifiedMessagingUrl = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.OABUrl:
          this.offlineAddressBookUrl =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.PublicFolderServer:
          this.publicFolderServer = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.Internal:
          await OutlookProtocol.LoadWebClientUrlsFromXml(
              reader, this.internalOutlookWebAccessUrls, reader.LocalName);
          break;
        case XmlElementNames.External:
          await OutlookProtocol.LoadWebClientUrlsFromXml(
              reader, this.externalOutlookWebAccessUrls, reader.LocalName);
          break;
        case XmlElementNames.Ssl:
          String sslStr = (await reader.ReadElementValue<String>())!;
          this.sslEnabled = sslStr.toLowerCase() == "on";
          break;
        case XmlElementNames.SharingUrl:
          this.sharingEnabled =
              (await reader.ReadElementValue<String>())!.length > 0;
          break;
        case XmlElementNames.EcpUrl:
          this.ecpUrl = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_um:
          this.ecpUrlUm = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_aggr:
          this.ecpUrlAggr = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_sms:
          this.ecpUrlSms = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_mt:
          this.ecpUrlMt = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_ret:
          this.ecpUrlRet = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_publish:
          this.ecpUrlPublish = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_photo:
          this.ecpUrlPhoto = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.ExchangeRpcUrl:
          this.exchangeRpcUrl = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EwsPartnerUrl:
          this.exchangeWebServicesPartnerUrl =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_connect:
          this.ecpUrlConnect = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_tm:
          this.ecpUrlTm = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_tmCreating:
          this.ecpUrlTmCreating = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_tmEditing:
          this.ecpUrlTmEditing = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_tmHiding:
          this.ecpUrlTmHiding = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.SiteMailboxCreationURL:
          this.siteMailboxCreationURL =
              await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.EcpUrl_extinstall:
          this.ecpUrlExtInstall = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.ServerExclusiveConnect:
          String serverExclusiveConnectStr =
              (await reader.ReadElementValue<String>())!;
          this.serverExclusiveConnect =
              serverExclusiveConnectStr.toLowerCase() == "on";
          break;
        case XmlElementNames.CertPrincipalName:
          this.certPrincipalName = await reader.ReadElementValue<String>();
          break;
        case XmlElementNames.GroupingInformation:
          this.groupingInformation = await reader.ReadElementValue<String>();
          break;
        default:
          await reader.SkipCurrentElement();
          break;
      }
    }
  } while (!reader.IsEndElementWithNamespace(
      XmlNamespace.NotSpecified, XmlElementNames.Protocol));
}