ParseDetailNode method

Future<void> ParseDetailNode(
  1. EwsXmlReader reader
)
Parses the detail node. The reader.

Implementation

/* private */
Future<void> ParseDetailNode(EwsXmlReader reader) async {
  do {
    await reader.Read();
    if (reader.NodeType == XmlNodeType.Element) {
      switch (reader.LocalName) {
        case XmlElementNames.EwsResponseCodeElementName:
          try {
            this.ResponseCode = await reader.ReadElementValue<ServiceError>();
          } catch (ArgumentException) {
            // ServiceError couldn't be mapped to enum value, treat as an ISE
            this.ResponseCode = ServiceError.ErrorInternalServerError;
          }

          break;

        case XmlElementNames.EwsMessageElementName:
          this.Message = await reader.ReadElementValue<String>();
          break;

        case XmlElementNames.EwsLineElementName:
          this.LineNumber = await reader.ReadElementValue<int>();
          break;

        case XmlElementNames.EwsPositionElementName:
          this.PositionWithinLine = await reader.ReadElementValue<int>();
          break;

        case XmlElementNames.EwsErrorCodeElementName:
          try {
            this.ErrorCode = await reader.ReadElementValue<ServiceError>();
          } catch (ArgumentException) {
            // ServiceError couldn't be mapped to enum value, treat as an ISE
            this.ErrorCode = ServiceError.ErrorInternalServerError;
          }

          break;

        case XmlElementNames.EwsExceptionTypeElementName:
          this.ExceptionType = await reader.ReadElementValue<String>();
          break;

        case XmlElementNames.MessageXml:
          await this.ParseMessageXml(reader);
          break;

        default:
          // Ignore any other details
          break;
      }
    }
  } while (!reader.IsEndElementWithNamespace(
      XmlNamespace.NotSpecified, XmlElementNames.SOAPDetailElementName));
}