// Token: 0x06001216 RID: 4630 RVA: 0x00062240 File Offset: 0x00060440 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); } RecurrenceData recurrenceData = nestedProperty.NestedData as RecurrenceData; if (recurrenceData == null) { throw new UnexpectedTypeException("RecurrenceData", nestedProperty.NestedData); } recurrenceData.Validate(); PatternedRecurrence patternedRecurrence = new PatternedRecurrence(); patternedRecurrence.Pattern = EntityRecurrenceProperty.CreateRecurrencePattern(recurrenceData); patternedRecurrence.Range = EntityRecurrenceProperty.CreateRecurrenceRange(base.CalendaringEvent.Start, recurrenceData); base.EntityPropertyDefinition.Setter(base.Item, patternedRecurrence); }
// Token: 0x06001007 RID: 4103 RVA: 0x0005B17C File Offset: 0x0005937C protected override void InternalCopyFrom(IProperty srcProperty) { INestedProperty nestedProperty = srcProperty as INestedProperty; if (nestedProperty == null) { throw new UnexpectedTypeException("INestedProperty", srcProperty); } RecurrenceData recurrenceData = nestedProperty.NestedData as RecurrenceData; if (recurrenceData == null) { throw new UnexpectedTypeException("RecurrenceData", nestedProperty.NestedData); } if (srcProperty.State != PropertyState.Modified) { return; } base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace); for (int i = 0; i < recurrenceData.Keys.Length; i++) { string text = recurrenceData.SubProperties[recurrenceData.Keys[i]] as string; if (text == null && recurrenceData.Keys[i] == "Type") { throw new ConversionException("Type of Recurrence has to be specified"); } if (text != null) { base.AppendChildNode(recurrenceData.Keys[i], text); } } base.XmlParentNode.AppendChild(base.XmlNode); }
// 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); } INestedData nestedData = nestedProperty.NestedData; if (nestedData == null) { throw new ConversionException("nestedData is NULL"); } if (PropertyState.SetToDefault == srcProperty.State) { return; } if (nestedData.SubProperties.Count == 0) { return; } base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace); IDictionaryEnumerator enumerator = nestedData.SubProperties.GetEnumerator(); while (enumerator.MoveNext()) { string qualifiedName = enumerator.Key as string; string text = enumerator.Value as string; if (text != null) { XmlNode newChild = base.XmlParentNode.OwnerDocument.CreateTextNode(text); XmlNode xmlNode = base.XmlParentNode.OwnerDocument.CreateElement(qualifiedName, base.Namespace); xmlNode.AppendChild(newChild); base.XmlNode.AppendChild(xmlNode); } } base.XmlParentNode.AppendChild(base.XmlNode); }
// Token: 0x06000FE5 RID: 4069 RVA: 0x0005A55C File Offset: 0x0005875C protected override void InternalCopyFrom(IProperty srcProperty) { INestedProperty nestedProperty = srcProperty as INestedProperty; if (nestedProperty == null) { throw new UnexpectedTypeException("INestedProperty", srcProperty); } if (PropertyState.Modified != srcProperty.State) { throw new ConversionException("Property only supports conversion from Modified property state"); } INestedData nestedData = nestedProperty.NestedData; if (nestedData == null) { throw new ConversionException("nestedData is NULL"); } base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace); this.AppendToXmlNode(base.XmlNode, nestedData); base.XmlParentNode.AppendChild(base.XmlNode); }
// Token: 0x060014A7 RID: 5287 RVA: 0x000779E8 File Offset: 0x00075BE8 protected override void InternalCopyFromModified(IProperty srcProperty) { Item mailboxItem = (Item)base.XsoItem; INestedProperty nestedProperty = (INestedProperty)srcProperty; FlagData flagData = (FlagData)nestedProperty.NestedData; if (flagData.Status == null || flagData.Status.Value == 0) { XsoFlagProperty.ClearFlag(mailboxItem); return; } if (flagData.Status == 2) { XsoFlagProperty.SetFlag(mailboxItem, flagData); return; } if (flagData.Status == 1) { XsoFlagProperty.CompleteFlag(mailboxItem, flagData); return; } throw new ConversionException("Flag Status cannot be a value other than 0, 1, 2"); }
// Token: 0x06000FEF RID: 4079 RVA: 0x0005AB74 File Offset: 0x00058D74 protected override void InternalCopyFrom(IProperty srcProperty) { INestedProperty nestedProperty = srcProperty as INestedProperty; if (nestedProperty == null) { throw new UnexpectedTypeException("INestedProperty", srcProperty); } if (PropertyState.Modified != srcProperty.State) { throw new ConversionException("Property only supports conversion from Modified property state"); } INestedData nestedData = nestedProperty.NestedData; if (nestedData == null) { throw new ConversionException("nestedData is NULL"); } base.XmlNode = base.XmlParentNode.OwnerDocument.CreateElement(base.AirSyncTagNames[0], base.Namespace); IDictionaryEnumerator enumerator = nestedData.SubProperties.GetEnumerator(); while (enumerator.MoveNext()) { string text = enumerator.Key as string; string text2 = enumerator.Value as string; if (text2 != null) { string namespaceURI = FlagData.IsTaskProperty(text) ? "Tasks:" : base.Namespace; XmlNode newChild = base.XmlParentNode.OwnerDocument.CreateTextNode(text2); XmlNode xmlNode = base.XmlParentNode.OwnerDocument.CreateElement(text, namespaceURI); xmlNode.AppendChild(newChild); base.XmlNode.AppendChild(xmlNode); } } base.XmlParentNode.AppendChild(base.XmlNode); }
public virtual void Visit(INestedProperty type, PropertyInfo propertyInfo, ElasticsearchPropertyAttributeBase attribute) { }
public virtual void Visit(INestedProperty property) { }
public void Visit(INestedProperty mapping) { Increment("nested"); }
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); }
public virtual void Visit(INestedProperty type, PropertyInfo propertyInfo, ElasticsearchPropertyAttribute attribute) { }
public override void Visit(INestedProperty property) => AddAlias(property);
protected override void InternalCopyFromModified(IProperty srcProperty) { CalendarItem calendarItem = null; Task task = null; if (this.recurrenceType == TypeOfRecurrence.Calendar) { calendarItem = (base.XsoItem as CalendarItem); if (calendarItem == null) { throw new UnexpectedTypeException("CalendarItem", base.XsoItem); } if (!calendarItem.IsOrganizer()) { AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "InternalCopyFromModified::Skip Recurrence change in case of attendee."); return; } } else if (this.recurrenceType == TypeOfRecurrence.Task) { task = (base.XsoItem as Task); if (task == null) { throw new UnexpectedTypeException("Task", base.XsoItem); } } INestedProperty nestedProperty = srcProperty as INestedProperty; if (nestedProperty == null) { throw new UnexpectedTypeException("INestedProperty", srcProperty); } RecurrenceData recurrenceData = nestedProperty.NestedData as RecurrenceData; if (recurrenceData == null) { throw new UnexpectedTypeException("RecurrenceData", nestedProperty.NestedData); } Recurrence recurrence = (this.recurrenceType == TypeOfRecurrence.Calendar) ? calendarItem.Recurrence : task.Recurrence; RecurrencePattern recurrencePattern = XsoRecurrenceProperty.CreateRecurrencePattern(this.recurrenceType, recurrenceData, recurrence); ExDateTime startDate = ExDateTime.MinValue; ExDateTime endDate = ExDateTime.MinValue; if (this.recurrenceType == TypeOfRecurrence.Calendar) { ExDateTime startTime = calendarItem.StartTime; ExTimeZone exTimeZoneFromItem = TimeZoneHelper.GetExTimeZoneFromItem(calendarItem); startDate = exTimeZoneFromItem.ConvertDateTime(startTime); if (recurrenceData.HasUntil()) { ExDateTime until = recurrenceData.Until; endDate = exTimeZoneFromItem.ConvertDateTime(until); } } else if (this.recurrenceType == TypeOfRecurrence.Task) { startDate = recurrenceData.Start; if (recurrenceData.HasUntil()) { endDate = recurrenceData.Until; } } RecurrenceRange range; try { if (recurrenceData.HasOccurences()) { range = new NumberedRecurrenceRange(startDate, (int)recurrenceData.Occurrences); } else if (recurrenceData.HasUntil()) { range = new EndDateRecurrenceRange(startDate, endDate); } else { range = new NoEndRecurrenceRange(startDate); } } catch (ArgumentException ex) { throw new ConversionException(ex.Message); } bool ignoreCalendarTypeAndIsLeapMonth = recurrenceData.ProtocolVersion < 140; if (recurrence != null && recurrence.Pattern != null && recurrence.Pattern.Equals(recurrencePattern, ignoreCalendarTypeAndIsLeapMonth)) { recurrencePattern = recurrence.Pattern; } try { if (this.recurrenceType == TypeOfRecurrence.Calendar) { ExTimeZone exTimeZoneFromItem2 = TimeZoneHelper.GetExTimeZoneFromItem(calendarItem); try { calendarItem.Recurrence = new Recurrence(recurrencePattern, range, exTimeZoneFromItem2, null); goto IL_295; } catch (ArgumentOutOfRangeException) { if (recurrenceData.CalendarType == CalendarType.Default) { recurrenceData.CalendarType = CalendarType.Gregorian; AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "Replace calendar recurrence calendar type with Gregorian."); recurrencePattern = XsoRecurrenceProperty.CreateRecurrencePattern(this.recurrenceType, recurrenceData, recurrence); calendarItem.Recurrence = new Recurrence(recurrencePattern, range, exTimeZoneFromItem2, null); goto IL_295; } throw; } } try { task.Recurrence = new Recurrence(recurrencePattern, range); } catch (ArgumentOutOfRangeException) { if (recurrenceData.CalendarType != CalendarType.Default) { throw; } recurrenceData.CalendarType = CalendarType.Gregorian; AirSyncDiagnostics.TraceInfo(ExTraceGlobals.CommonTracer, null, "Replace task recurrence calendar type with Gregorian."); recurrencePattern = XsoRecurrenceProperty.CreateRecurrencePattern(this.recurrenceType, recurrenceData, recurrence); task.Recurrence = new Recurrence(recurrencePattern, range); } task[TaskSchema.IsOneOff] = recurrenceData.DeadOccur; IL_295 :; } catch (NotSupportedException ex2) { throw new ConversionException(ex2.Message); } }