WriteElementsToXml method

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

Implementation

@override
void WriteElementsToXml(EwsServiceXmlWriter writer) {
  if (this.Offset != null) {
    writer.WriteElementValueWithNamespace(
        XmlNamespace.Types,
        XmlElementNames.Offset,
        EwsUtilities.TimeSpanToXSDuration(this.Offset!));
  }

  if (this.Recurrence != null) {
    this
        .Recurrence!
        .WriteToXml(writer, XmlElementNames.RelativeYearlyRecurrence);
  }

  if (this.AbsoluteDate != null) {
    writer.WriteElementValueWithNamespace(
        XmlNamespace.Types,
        XmlElementNames.AbsoluteDate,
        EwsUtilities.DateTimeToXSDate(this.AbsoluteDate!));
    // todo : review absolute date conversation
//                    EwsUtilities.DateTimeToXSDate(new DateTime(this.AbsoluteDate.Value.Ticks, DateTimeKind.Unspecified)));
  }

  if (this.Time != null) {
    writer.WriteElementValueWithNamespace(
        XmlNamespace.Types, XmlElementNames.Time, this.Time!.ToXSTime());
  }
}