LoadFromXml method

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

Implementation

Future<void> LoadFromXml(EwsServiceXmlReader reader) async {
  await reader.ReadStartElementWithNamespace(
      XmlNamespace.Types, XmlElementNames.Resolution);

  await reader.ReadStartElementWithNamespace(
      XmlNamespace.Types, XmlElementNames.Mailbox);
  await this._mailbox.LoadFromXml(reader, XmlElementNames.Mailbox);

  await reader.Read();
  if (reader.IsStartElementWithNamespace(
      XmlNamespace.Types, XmlElementNames.Contact)) {
    this._contact = new items.Contact(this._owner.Session!);

    // Contacts returned by ResolveNames should behave like Contact.Load with FirstClassPropertySet specified.
    await this._contact!.LoadFromXmlWithPropertySet(
        reader,
        true,
        /* clearPropertyBag */
        PropertySet.FirstClassProperties,
        false); /* summaryPropertiesOnly */

    await reader.ReadEndElementWithNamespace(
        XmlNamespace.Types, XmlElementNames.Resolution);
  } else {
    reader.EnsureCurrentNodeIsEndElement(
        XmlNamespace.Types, XmlElementNames.Resolution);
  }
}