WriteToXml method

void WriteToXml(
  1. EwsServiceXmlWriter writer,
  2. String xmlElementName
)
Writes to XML. The writer. Name of the XML element.

Implementation

void WriteToXml(EwsServiceXmlWriter writer, String xmlElementName) {
  if (this.Count > 0) {
    writer.WriteStartElement(XmlNamespace.Messages, xmlElementName);

    for (MapEntry<PropertyDefinitionBase, SortDirection> keyValuePair
        in this) {
      writer.WriteStartElement(
          XmlNamespace.Types, XmlElementNames.FieldOrder);

      writer.WriteAttributeValue(XmlAttributeNames.Order, keyValuePair.value);
      keyValuePair.key.WriteToXml(writer);

      writer.WriteEndElement(); // FieldOrder
    }

    writer.WriteEndElement();
  }
}