TryReadElementFromXml method

  1. @override
Future<bool> TryReadElementFromXml(
  1. EwsServiceXmlReader reader
)
override
Tries to read element from XML. The reader.

Implementation

@override
Future<bool> TryReadElementFromXml(EwsServiceXmlReader reader) async {
  switch (reader.LocalName) {
    case XmlElementNames.Street:
      this._street = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.City:
      this._city = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.State:
      this._state = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.Country:
      this._country = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.PostalCode:
      this._postalCode = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.PostOfficeBox:
      this._postOfficeBox = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.PostalAddressType:
      this._type = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.Latitude:
      this._latitude = await reader.ReadValue<double>();
      return true;
    case XmlElementNames.Longitude:
      this._longitude = await reader.ReadValue<double>();
      return true;
    case XmlElementNames.Accuracy:
      this._accuracy = await reader.ReadValue<double>();
      return true;
    case XmlElementNames.Altitude:
      this._altitude = await reader.ReadValue<double>();
      return true;
    case XmlElementNames.AltitudeAccuracy:
      this._altitudeAccuracy = await reader.ReadValue<double>();
      return true;
    case XmlElementNames.FormattedAddress:
      this._formattedAddress = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.LocationUri:
      this._uri = await reader.ReadValue<String>();
      return true;
    case XmlElementNames.LocationSource:
      this._source = await reader.ReadValue<LocationSource>();
      return true;
    default:
      return false;
  }
}