WriteAttributesToXml method

  1. @override
void WriteAttributesToXml(
  1. EwsServiceXmlWriter writer
)
override
Writes the attributes to XML. The writer.

Implementation

@override
void WriteAttributesToXml(EwsServiceXmlWriter writer) {
  writer.WriteAttributeValue(
      XmlAttributeNames.ReturnFullContactData, this.ReturnFullContactData);

  String? searchScope = null;

  searchScope = _searchScopeMap.Member![this.SearchLocation!];

  EwsUtilities.Assert(
      !StringUtils.IsNullOrEmpty(searchScope),
      "ResolveNameRequest.WriteAttributesToXml",
      "The specified search location cannot be mapped to an EWS search scope.");

  String? propertySet = null;
  if (this._contactDataPropertySet != null) {
    propertySet = PropertySet.DefaultPropertySetMap
        .Member![this._contactDataPropertySet!.BasePropertySet!];
  }

  if (!this.Service.Exchange2007CompatibilityMode) {
    writer.WriteAttributeValue(XmlAttributeNames.SearchScope, searchScope);
  }
  if (!StringUtils.IsNullOrEmpty(propertySet)) {
    writer.WriteAttributeValue(
        XmlAttributeNames.ContactDataShape, propertySet);
  }
}