// 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); }
// 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; } }
// 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); }
protected override void InternalCopyFrom(IProperty srcProperty) { INestedProperty nestedProperty = srcProperty as INestedProperty; if (nestedProperty == null) { throw new UnexpectedTypeException("INestedProperty", srcProperty); } MeetingRequestData meetingRequestData = nestedProperty.NestedData as MeetingRequestData; if (meetingRequestData == null) { throw new UnexpectedTypeException("MeetingRequestData", nestedProperty.NestedData); } if (PropertyState.Modified != srcProperty.State) { return; } base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace); string[] keysForVersion = MeetingRequestData.GetKeysForVersion(this.protocolVersion); for (int i = 0; i < keysForVersion.Length; i++) { object obj = meetingRequestData.SubProperties[keysForVersion[i]]; string text = obj as string; if (text != null) { base.AppendChildNode(base.XmlNode, keysForVersion[i], text, MeetingRequestData.GetEmailNamespaceForKey(i)); } else { RecurrenceData recurrenceData = obj as RecurrenceData; if (recurrenceData != null) { if (!(recurrenceData.SubProperties["Type"] is string)) { throw new ConversionException("Type of Recurrence has to be specified"); } XmlNode xmlNode = base.XmlParentNode.OwnerDocument.CreateElement(MeetingRequestData.Tags.Recurrences.ToString(), base.Namespace); XmlNode xmlNode2 = base.XmlParentNode.OwnerDocument.CreateElement("Recurrence", base.Namespace); for (int j = 0; j < recurrenceData.Keys.Length; j++) { string text2 = recurrenceData.SubProperties[recurrenceData.Keys[j]] as string; if (text2 != null) { base.AppendChildNode(xmlNode2, recurrenceData.Keys[j], text2, RecurrenceData.GetEmailNamespaceForKey(j)); } } xmlNode.AppendChild(xmlNode2); base.XmlNode.AppendChild(xmlNode); } else { EnhancedLocationData enhancedLocationData = obj as EnhancedLocationData; if (enhancedLocationData != null && this.protocolVersion >= 160) { XmlNode xmlNode3 = base.XmlParentNode.OwnerDocument.CreateElement("Location", "AirSyncBase:"); base.AppendToXmlNode(xmlNode3, enhancedLocationData, "AirSyncBase:"); base.XmlNode.AppendChild(xmlNode3); } } } } base.XmlParentNode.AppendChild(base.XmlNode); }