TryReadElementFromXml method

  1. @override
Future<bool> TryReadElementFromXml(
  1. EwsServiceXmlReader reader
)
override
Tries to read element from XML. The reader.

Implementation

@override
Future<bool> TryReadElementFromXml(EwsServiceXmlReader reader) async {
  switch (reader.LocalName) {
    case XmlElementNames.UserId:
      this.UserId = new property.UserId();
      await this.UserId!.LoadFromXml(reader, reader.LocalName);
      return true;
    case XmlElementNames.CanCreateItems:
      this._canCreateItems = await reader.ReadValue<bool>();
      return true;
    case XmlElementNames.CanCreateSubFolders:
      this._canCreateSubFolders = await reader.ReadValue<bool>();
      return true;
    case XmlElementNames.IsFolderOwner:
      this._isFolderOwner = await reader.ReadValue<bool>();
      return true;
    case XmlElementNames.IsFolderVisible:
      this._isFolderVisible = await reader.ReadValue<bool>();
      return true;
    case XmlElementNames.IsFolderContact:
      this._isFolderContact = await reader.ReadValue<bool>();
      return true;
    case XmlElementNames.EditItems:
      this._editItems = await reader.ReadValue<PermissionScope>();
      return true;
    case XmlElementNames.DeleteItems:
      this._deleteItems = await reader.ReadValue<PermissionScope>();
      return true;
    case XmlElementNames.ReadItems:
      this._readItems = await reader.ReadValue<FolderPermissionReadAccess>();
      return true;
    case XmlElementNames.PermissionLevel:
    case XmlElementNames.CalendarPermissionLevel:
      this._permissionLevel = await reader.ReadValue<FolderPermissionLevel>();
      return true;
    default:
      return false;
  }
}