InternalReadElementWithNamespace method

Future<void> InternalReadElementWithNamespace(
  1. XmlNamespace xmlNamespace,
  2. String? localName,
  3. XmlNodeType nodeType
)
Read XML element. The XML namespace. Name of the local. Type of the node.

Implementation

/* private */
Future<void> InternalReadElementWithNamespace(
  XmlNamespace xmlNamespace,
  String? localName,
  XmlNodeType nodeType,
) async {
  if (xmlNamespace == XmlNamespace.NotSpecified) {
    await _InternalReadElement("", localName, nodeType);
  } else {
    await Read(nodeType: nodeType);

    if ((LocalName != localName) ||
        (NamespaceUri != EwsUtilities.GetNamespaceUri(xmlNamespace))) {
      throw ServiceXmlDeserializationException("""string.Format(
                          Strings.UnexpectedElement,
                          ${EwsUtilities.GetNamespacePrefix(xmlNamespace)},
                          $localName,
                          $nodeType,
                          ${_xmlReader.Name},
                          $NodeType)""");
    }
  }
}