ReadAttributesFromXml method

  1. @override
void ReadAttributesFromXml(
  1. EwsServiceXmlReader reader
)
override
Reads the attributes from XML. The reader.

Implementation

@override
void ReadAttributesFromXml(EwsServiceXmlReader reader) {
  super.ReadAttributesFromXml(reader);

  containmentMode = reader.ReadAttributeValue<enumerations.ContainmentMode>(
    XmlAttributeNames.ContainmentMode,
  );

  try {
    comparisonMode = reader.ReadAttributeValue<enumerations.ComparisonMode>(
      XmlAttributeNames.ContainmentComparison,
    );
  } catch (ArgumentException) {
    // This will happen if we receive a value that is defined in the EWS schema but that is not defined
    // in the API (see the comments in ComparisonMode.cs). We map that value to IgnoreCaseAndNonSpacingCharacters.
    comparisonMode =
        enumerations.ComparisonMode.IgnoreCaseAndNonSpacingCharacters;
  }
}