LoadFromXml static method

Read user setting with ProtocolConnectionCollection value. EwsServiceXmlReader

Implementation

static Future<ProtocolConnectionCollection> LoadFromXml(
    EwsXmlReader reader) async {
  ProtocolConnectionCollection value = new ProtocolConnectionCollection();
  ProtocolConnection? connection = null;

  do {
    await reader.Read();

    if (reader.NodeType == XmlNodeType.Element) {
      if (reader.LocalName == XmlElementNames.ProtocolConnection) {
        connection = await ProtocolConnection.LoadFromXml(reader);
        if (connection != null) {
          value.Connections!.add(connection);
        }
      }
    }
  } while (!reader.IsEndElementWithNamespace(
      XmlNamespace.Autodiscover, XmlElementNames.ProtocolConnections));

  return value;
}