LoadFromXml static method

Read user setting with ProtocolConnectionCollection value. EwsServiceXmlReader

Implementation

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

  do {
    reader.Read();

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

  return value;
}