Exemplo n.º 1
0
        /// <summary>
        /// Loads from json.
        /// </summary>
        /// <param name="jsonProperty">The json property.</param>
        /// <param name="service"></param>
        internal override void LoadFromJson(JsonObject jsonProperty, ExchangeService service)
        {
            foreach (string key in jsonProperty.Keys)
            {
                switch (key)
                {
                case XmlElementNames.Street:
                    this.street = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.City:
                    this.city = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.Country:
                    this.country = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.PostalCode:
                    this.postalCode = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.PostOfficeBox:
                    this.postOfficeBox = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.PostalAddressType:
                    this.type = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.Latitude:
                    this.latitude = jsonProperty.ReadAsDouble(key);
                    break;

                case XmlElementNames.Longitude:
                    this.longitude = jsonProperty.ReadAsDouble(key);
                    break;

                case XmlElementNames.Accuracy:
                    this.accuracy = jsonProperty.ReadAsDouble(key);
                    break;

                case XmlElementNames.Altitude:
                    this.altitude = jsonProperty.ReadAsDouble(key);
                    break;

                case XmlElementNames.AltitudeAccuracy:
                    this.altitudeAccuracy = jsonProperty.ReadAsDouble(key);
                    break;

                case XmlElementNames.FormattedAddress:
                    this.formattedAddress = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.LocationUri:
                    this.uri = jsonProperty.ReadAsString(key);
                    break;

                case XmlElementNames.LocationSource:
                    this.source = jsonProperty.ReadEnumValue <LocationSource>(key);
                    break;

                default:
                    break;
                }
            }
        }