TryReadElementFromXml method

  1. @override
bool TryReadElementFromXml(
  1. EwsServiceXmlReader reader
)
override
Defines an implicit conversion between a String representing an SMTP address and Mailbox. The SMTP address to convert to EmailAddress. Tries to read element from XML. The reader.

Implementation

// static implicit operator Mailbox(String smtpAddress)
//        {
//            return new Mailbox(smtpAddress);
//        }

/// <summary>
/// Tries to read element from XML.
/// </summary>
/// <param name="reader">The reader.</param>
/// <returns>True if element was read.</returns>
@override
bool TryReadElementFromXml(EwsServiceXmlReader reader) {
  switch (reader.LocalName) {
    case XmlElementNames.EmailAddress:
      this.Address = reader.ReadElementValue<String>();
      return true;
    case XmlElementNames.RoutingType:
      this.RoutingType = reader.ReadElementValue<String>();
      return true;
    default:
      return false;
  }
}