GetXmlElementNameOverride method

  1. @override
String? GetXmlElementNameOverride()
override
This methods lets subclasses of ServiceObject override the default mechanism by which the XML element name associated with their type is retrieved.

Implementation

@override
String? GetXmlElementNameOverride() {
  switch (this._responseType) {
    case ResponseMessageType.Reply:
      return XmlElementNames.ReplyToItem;
    case ResponseMessageType.ReplyAll:
      return XmlElementNames.ReplyAllToItem;
    case ResponseMessageType.Forward:
      return XmlElementNames.ForwardItem;
    default:
      EwsUtilities.Assert(false, "ResponseMessage.GetXmlElementNameOverride",
          "An unexpected value for responseType could not be handled.");
      return null; // Because the compiler wants it
  }
}