WriteElementsToXml method

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

Implementation

@override
void WriteElementsToXml(EwsServiceXmlWriter writer) {
  this.View!.WriteToXml(writer, this.GetGroupBy());

  if (this.SearchFilter != null) {
    writer.WriteStartElement(
        XmlNamespace.Messages, XmlElementNames.Restriction);
    this.SearchFilter!.WriteToXmlWithWriter(writer);
    writer.WriteEndElement(); // Restriction
  }

  this.View!.WriteOrderByToXml(writer);

  this.ParentFolderIds.WriteToXml(
      writer, XmlNamespace.Messages, XmlElementNames.ParentFolderIds);

  if (!StringUtils.IsNullOrEmpty(this.queryString)) {
    // Emit the QueryString
    //
    writer.WriteStartElement(
        XmlNamespace.Messages, XmlElementNames.QueryString);

    if (this.ReturnHighlightTerms) {
      writer.WriteAttributeString(XmlAttributeNames.ReturnHighlightTerms,
          this.ReturnHighlightTerms.toString().toLowerCase());
    }

    writer.WriteValue(this.queryString, XmlElementNames.QueryString);
    writer.WriteEndElement();
  }
}