TryReadElementFromXml method

  1. @override
bool TryReadElementFromXml(
  1. EwsServiceXmlReader reader
)
override
Initializes a new instance of the The location DisplayName. Initializes a new instance of the The location DisplayName. The annotation on the location. Initializes a new instance of the The location DisplayName. The annotation on the location. The persona postal address. Tries to read element from XML. The reader.

Implementation

// EnhancedLocation(String displayName)
//            : this(displayName, String.Empty, new complex.PersonaPostalAddress())
//        {
//        }

/// <summary>
/// Initializes a new instance of the <see cref="EnhancedLocation"/> class.
/// </summary>
/// <param name="displayName">The location DisplayName.</param>
/// <param name="annotation">The annotation on the location.</param>
// EnhancedLocation(String displayName, String annotation)
//            : this(displayName, annotation, new complex.PersonaPostalAddress())
//        {
//        }

/// <summary>
/// Initializes a new instance of the <see cref="EnhancedLocation"/> class.
/// </summary>
/// <param name="displayName">The location DisplayName.</param>
/// <param name="annotation">The annotation on the location.</param>
/// <param name="personaPostalAddress">The persona postal address.</param>
// EnhancedLocation(String displayName, String annotation, complex.PersonaPostalAddress personaPostalAddress)
//            : this()
//        {
//            this.displayName = displayName;
//            this.annotation = annotation;
//            this.personaPostalAddress = personaPostalAddress;
//            this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
//        }

/// <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.LocationDisplayName:
      this._displayName = reader.ReadValue<String>();
      return true;
    case XmlElementNames.LocationAnnotation:
      this._annotation = reader.ReadValue<String>();
      return true;
    case XmlElementNames.PersonaPostalAddress:
      this._personaPostalAddress = new complex.PersonaPostalAddress();
      this._personaPostalAddress!.LoadFromXmlElementName(reader);
      this
          ._personaPostalAddress!
          .addOnChangeEvent(_PersonaPostalAddress_OnChange);
      return true;
    default:
      return false;
  }
}