WriteElementsToXml method

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

Implementation

@override
void WriteElementsToXml(EwsServiceXmlWriter writer) {
  writer.WriteStartElement(XmlNamespace.Types, this.XmlElementName);
  this.InternalWritePropertiesToXml(writer);
  writer.WriteEndElement();

  complex.RecurrenceRange range;

  if (!this.HasEnd) {
    range = new NoEndRecurrenceRange.withStartDate(this.StartDate);
  } else if (this.NumberOfOccurrences != 0) {
    range = new NumberedRecurrenceRange.withStartDate(
        this.StartDate, this.NumberOfOccurrences);
  } else {
    range = new EndDateRecurrenceRange.withStartAndEndDates(
        this.StartDate, this.EndDate);
  }

  range.WriteToXml(writer, range.XmlElementName);
}