InternalLoadFromXml method

  1. @override
Future<void> InternalLoadFromXml(
  1. EwsServiceXmlReader reader
)
override
Load from XML. The reader.

Implementation

@override
Future<void> InternalLoadFromXml(EwsServiceXmlReader reader) async {
  await super.InternalLoadFromXml(reader);

  this._folderId = new complex.FolderId();
  await this._folderId!.LoadFromXml(reader, reader.LocalName);

  await reader.Read();

  this.ParentFolderId = new complex.FolderId();
  await this
      .ParentFolderId!
      .LoadFromXml(reader, XmlElementNames.ParentFolderId);

  switch (this.EventType) {
    case EventType.Moved:
    case EventType.Copied:
      await reader.Read();

      this._oldFolderId = new complex.FolderId();
      await this._oldFolderId!.LoadFromXml(reader, reader.LocalName);

      await reader.Read();

      this.OldParentFolderId = new complex.FolderId();
      await this.OldParentFolderId!.LoadFromXml(reader, reader.LocalName);
      break;

    case EventType.Modified:
      await reader.Read();
      if (reader.IsStartElement()) {
        reader.EnsureCurrentNodeIsStartElementWithNamespace(
            XmlNamespace.Types, XmlElementNames.UnreadCount);
        this._unreadCount = int.parse(await reader.ReadValue());
      }
      break;

    default:
      break;
  }
}