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 {
  if (await super.TryReadElementFromXml(reader)) {
    return true;
  } else {
    switch (reader.LocalName) {
      case XmlElementNames.DayOfWeek:
        this.dayOfTheWeek =
            await reader.ReadElementValue<enumerations.DayOfTheWeek>();
        return true;
      case XmlElementNames.Occurrence:
        this.weekIndex = await reader.ReadElementValue<int>();
        return true;
      default:
        return false;
    }
  }
}