WriteToXmlWithWriter method

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

Implementation

@override
void WriteToXmlWithWriter(EwsServiceXmlWriter writer) {
  // If there is only one filter in the collection, which developers tend to do,
  // we need to not emit the collection and instead only emit the one filter within
  // the collection. This is to work around the fact that EWS does not allow filter
  // collections that have less than two elements.
  if (this.Count == 1) {
    this[0].WriteToXmlWithWriter(writer);
  } else {
    super.WriteToXmlWithWriter(writer);
  }
}