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,
    ReturnFullContactData,
  );

  String? searchScope;

  searchScope = _searchScopeMap.Member![SearchLocation!];

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

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

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