TryReadElementFromXml method

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

Implementation

@override
Future<bool> TryReadElementFromXml(EwsServiceXmlReader reader) async {
  switch (reader.LocalName) {
    case XmlElementNames.Id:
      this.Id = await reader.ReadElementValue<String>();
      break;
    case XmlElementNames.SourceId:
      this.SourceId = new ItemId();
      await this.SourceId.LoadFromXml(reader, reader.LocalName);
      break;
    case XmlElementNames.DisplayName:
      this.DisplayName = await reader.ReadElementValue<String>();
      break;
    case XmlElementNames.IsWritable:
      this.IsWritable = await reader.ReadElementValue<bool>();
      break;
    case XmlElementNames.IsQuickContact:
      this.IsQuickContact = await reader.ReadElementValue<bool>();
      break;
    case XmlElementNames.IsHidden:
      this.IsHidden = await reader.ReadElementValue<bool>();
      break;
    case XmlElementNames.FolderId:
      this.FolderId = new complex.FolderId();
      await this.FolderId!.LoadFromXml(reader, reader.LocalName);
      break;

    default:
      return super.TryReadElementFromXml(reader);
  }

  return true;
}