Exemplo n.º 1
0
        // Token: 0x060011F1 RID: 4593 RVA: 0x00061B18 File Offset: 0x0005FD18
        private static Location CreateLocation(EnhancedLocationData enhancedLocationData)
        {
            Location location = new Location();

            location.DisplayName = enhancedLocationData.DisplayName;
            location.Annotation  = enhancedLocationData.Annotation;
            PostalAddress postalAddress = new PostalAddress();

            postalAddress.Street           = enhancedLocationData.Street;
            postalAddress.City             = enhancedLocationData.City;
            postalAddress.State            = enhancedLocationData.State;
            postalAddress.Country          = enhancedLocationData.Country;
            postalAddress.PostalCode       = enhancedLocationData.PostalCode;
            postalAddress.Latitude         = EntityEnhancedLocationProperty.StringToNullableDouble(enhancedLocationData.Latitude);
            postalAddress.Longitude        = EntityEnhancedLocationProperty.StringToNullableDouble(enhancedLocationData.Longitude);
            postalAddress.Accuracy         = EntityEnhancedLocationProperty.StringToNullableDouble(enhancedLocationData.Accuracy);
            postalAddress.Altitude         = EntityEnhancedLocationProperty.StringToNullableDouble(enhancedLocationData.Altitude);
            postalAddress.AltitudeAccuracy = EntityEnhancedLocationProperty.StringToNullableDouble(enhancedLocationData.AltitudeAccuracy);
            postalAddress.LocationUri      = enhancedLocationData.LocationUri;
            if (!postalAddress.IsEmpty())
            {
                location.Address = postalAddress;
            }
            return(location);
        }
Exemplo n.º 2
0
        // Token: 0x060011F2 RID: 4594 RVA: 0x00061BF8 File Offset: 0x0005FDF8
        private static void PopulateLocation(EnhancedLocationData enhancedLocationData, Location location)
        {
            enhancedLocationData.DisplayName = location.DisplayName;
            enhancedLocationData.Annotation  = location.Annotation;
            PostalAddress address = location.Address;

            if (address != null && !address.IsEmpty())
            {
                enhancedLocationData.Street           = address.Street;
                enhancedLocationData.City             = address.City;
                enhancedLocationData.State            = address.State;
                enhancedLocationData.Country          = address.Country;
                enhancedLocationData.PostalCode       = address.PostalCode;
                enhancedLocationData.Latitude         = EntityEnhancedLocationProperty.NullableDoubleToString(address.Latitude);
                enhancedLocationData.Longitude        = EntityEnhancedLocationProperty.NullableDoubleToString(address.Longitude);
                enhancedLocationData.Accuracy         = EntityEnhancedLocationProperty.NullableDoubleToString(address.Accuracy);
                enhancedLocationData.Altitude         = EntityEnhancedLocationProperty.NullableDoubleToString(address.Altitude);
                enhancedLocationData.AltitudeAccuracy = EntityEnhancedLocationProperty.NullableDoubleToString(address.AltitudeAccuracy);
                enhancedLocationData.LocationUri      = address.LocationUri;
            }
        }
Exemplo n.º 3
0
        // Token: 0x060011F0 RID: 4592 RVA: 0x00061A88 File Offset: 0x0005FC88
        public override void CopyFrom(IProperty srcProperty)
        {
            if (base.EntityPropertyDefinition.Setter == null)
            {
                throw new ConversionException("Unable to set data of type " + base.EntityPropertyDefinition.Type.FullName);
            }
            INestedProperty nestedProperty = srcProperty as INestedProperty;

            if (nestedProperty == null)
            {
                throw new UnexpectedTypeException("INestedProperty", srcProperty);
            }
            EnhancedLocationData enhancedLocationData = nestedProperty.NestedData as EnhancedLocationData;

            if (enhancedLocationData == null)
            {
                throw new UnexpectedTypeException("EnhancedLocationData", nestedProperty.NestedData);
            }
            Location arg = EntityEnhancedLocationProperty.CreateLocation(enhancedLocationData);

            base.EntityPropertyDefinition.Setter(base.Item, arg);
        }