WriteElementsToXml method

  1. @override
void WriteElementsToXml(
  1. EwsServiceXmlWriter writer
)
override
Writes elements to XML. The writer.

Implementation

@override
void WriteElementsToXml(EwsServiceXmlWriter writer) {
  super.WriteElementsToXml(writer);

  // C# passes the DateTime to WriteElementValue, which converts it to UTC using
  // the service's time zone. The transition date is a local (unbiased) value,
  // which is also how Exchange returns it, so it is written without conversion.
  writer.WriteElementValueWithNamespace(
    XmlNamespace.Types,
    XmlElementNames.DateTime,
    EwsUtilities.DateTimeToXSDateTime(
      core.DateTime(
        _dateTime!.year,
        _dateTime!.month,
        _dateTime!.day,
        _dateTime!.hour,
        _dateTime!.minute,
        _dateTime!.second,
      ),
    ),
  );
}