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 {
    if (reader.LocalName == XmlElementNames.Day) {
      this.dayOfMonth = await reader.ReadElementValue<int>();

      EwsUtilities.Assert(
          this.dayOfMonth! > 0 && this.dayOfMonth! <= 31,
          "AbsoluteDayOfMonthTransition.TryReadElementFromXml",
          "dayOfMonth is not in the valid 1 - 31 range.");

      return true;
    } else {
      return false;
    }
  }
}