public RecurrenceData(TypeOfRecurrence type, int protocolVersion) { this.subProperties = new Hashtable(); this.recurrenceType = type; this.protocolVersion = protocolVersion; this.Clear(); }
// Token: 0x06001006 RID: 4102 RVA: 0x0005B165 File Offset: 0x00059365 public AirSyncRecurrenceProperty(string xmlNodeNamespace, string airSyncTagName, TypeOfRecurrence recurrenceType, bool requiresClientSupport, int protocolVersion) : base(xmlNodeNamespace, airSyncTagName, new RecurrenceData(recurrenceType, protocolVersion), requiresClientSupport) { }
private static RecurrencePattern CreateRecurrencePattern(TypeOfRecurrence recurrenceType, RecurrenceData recurrenceData, Recurrence oldRecurrence) { ushort recurrenceInterval = 1; RecurrenceData.RecurrenceType type = recurrenceData.Type; if (recurrenceData.HasInterval()) { recurrenceInterval = recurrenceData.Interval; } if (recurrenceData.HasWeekOfMonth()) { recurrenceData.WeekOfMonth = ((recurrenceData.WeekOfMonth == 5) ? byte.MaxValue : recurrenceData.WeekOfMonth); } if (recurrenceType == TypeOfRecurrence.Calendar || (recurrenceType == TypeOfRecurrence.Task && !recurrenceData.Regenerate)) { switch (type) { case RecurrenceData.RecurrenceType.Daily: if (recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["CalendarType"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfMonth, WeekOfMonth, MonthOfYear, CalendarType, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } if (recurrenceData.SubProperties["DayOfWeek"] != null) { return(new WeeklyRecurrencePattern((DaysOfWeek)recurrenceData.DayOfWeek, (int)recurrenceInterval)); } return(new DailyRecurrencePattern((int)recurrenceInterval)); case RecurrenceData.RecurrenceType.Weekly: { if (recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["CalendarType"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfMonth, WeekOfMonth, MonthOfYear, CalendarType, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } if (recurrenceData.SubProperties["DayOfWeek"] == null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek is expected with recurrence type {0}", new object[] { type.ToString() })); } WeeklyRecurrencePattern weeklyRecurrencePattern = (oldRecurrence != null) ? (oldRecurrence.Pattern as WeeklyRecurrencePattern) : null; return(new WeeklyRecurrencePattern((DaysOfWeek)recurrenceData.DayOfWeek, (int)recurrenceInterval, (recurrenceData.ProtocolVersion < 141 && weeklyRecurrencePattern != null) ? weeklyRecurrencePattern.FirstDayOfWeek : recurrenceData.FirstDayOfWeek)); } case RecurrenceData.RecurrenceType.Monthly: if (recurrenceData.SubProperties["DayOfWeek"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek, WeekOfMonth, MonthOfYear, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } if (recurrenceData.SubProperties["DayOfMonth"] == null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfMonth is expected with recurrence type {0}", new object[] { type.ToString() })); } return(new MonthlyRecurrencePattern((int)recurrenceData.DayOfMonth, (int)recurrenceInterval, recurrenceData.CalendarType)); case RecurrenceData.RecurrenceType.MonthlyTh: { if (recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfMonth, MonthOfYear, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } if (recurrenceData.SubProperties["WeekOfMonth"] == null || recurrenceData.SubProperties["DayOfWeek"] == null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "WeekOfMonth, DayOfWeek is expected with recurrence type {0}", new object[] { type.ToString() })); } RecurrenceOrderType recurrenceOrderType = (recurrenceData.WeekOfMonth == byte.MaxValue) ? RecurrenceOrderType.Last : ((RecurrenceOrderType)recurrenceData.WeekOfMonth); if (!EnumValidator.IsValidValue <RecurrenceOrderType>(recurrenceOrderType)) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "WeekOfMonth value {0} is invalid", new object[] { recurrenceOrderType.ToString() })); } return(new MonthlyThRecurrencePattern((DaysOfWeek)recurrenceData.DayOfWeek, recurrenceOrderType, (int)recurrenceInterval, recurrenceData.CalendarType)); } case RecurrenceData.RecurrenceType.Yearly: if (recurrenceData.SubProperties["DayOfWeek"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek, WeekOfMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } if (recurrenceData.SubProperties["DayOfMonth"] == null || recurrenceData.SubProperties["MonthOfYear"] == null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfMonth, MonthOfYear is expected with recurrence type {0}", new object[] { type.ToString() })); } return(new YearlyRecurrencePattern((int)recurrenceData.DayOfMonth, (int)recurrenceData.MonthOfYear, recurrenceData.IsLeapMonth, recurrenceData.CalendarType)); case RecurrenceData.RecurrenceType.YearlyTh: { if (recurrenceData.SubProperties["DayOfMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } if (recurrenceData.SubProperties["WeekOfMonth"] == null || recurrenceData.SubProperties["DayOfWeek"] == null || recurrenceData.SubProperties["MonthOfYear"] == null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "WeekOfMonth, DayOfWeek, MonthOfYear is expected with recurrence type {0}", new object[] { type.ToString() })); } RecurrenceOrderType recurrenceOrderType = (recurrenceData.WeekOfMonth == byte.MaxValue) ? RecurrenceOrderType.Last : ((RecurrenceOrderType)recurrenceData.WeekOfMonth); if (!EnumValidator.IsValidValue <RecurrenceOrderType>(recurrenceOrderType)) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "WeekOfMonth value {0} is invalid", new object[] { recurrenceOrderType.ToString() })); } return(new YearlyThRecurrencePattern((DaysOfWeek)recurrenceData.DayOfWeek, recurrenceOrderType, (int)recurrenceData.MonthOfYear, recurrenceData.IsLeapMonth, recurrenceData.CalendarType)); } } throw new ConversionException("Unexpected recurrence type, should have been caught in a higher validation layer"); } switch (type) { case RecurrenceData.RecurrenceType.Daily: if (recurrenceData.SubProperties["DayOfWeek"] != null || recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["CalendarType"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek, DayOfMonth, WeekOfMonth, MonthOfYear, CalendarType, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } return(new DailyRegeneratingPattern((int)recurrenceInterval)); case RecurrenceData.RecurrenceType.Weekly: if (recurrenceData.SubProperties["DayOfWeek"] != null || recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["CalendarType"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek, DayOfMonth, WeekOfMonth, MonthOfYear, CalendarType, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } return(new WeeklyRegeneratingPattern((int)recurrenceInterval)); case RecurrenceData.RecurrenceType.Monthly: if (recurrenceData.SubProperties["DayOfWeek"] != null || recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null || recurrenceData.SubProperties["IsLeapMonth"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek, DayOfMonth, WeekOfMonth, MonthOfYear, IsLeapMonth is not expected with recurrence type {0}", new object[] { type.ToString() })); } return(new MonthlyRegeneratingPattern((int)recurrenceInterval, recurrenceData.CalendarType)); case RecurrenceData.RecurrenceType.Yearly: if (recurrenceData.SubProperties["DayOfWeek"] != null || recurrenceData.SubProperties["DayOfMonth"] != null || recurrenceData.SubProperties["WeekOfMonth"] != null || recurrenceData.SubProperties["MonthOfYear"] != null) { throw new ConversionException(string.Format(CultureInfo.InvariantCulture, "DayOfWeek, DayOfMonth, WeekOfMonth, MonthOfYear is not expected with recurrence type {0}", new object[] { type.ToString() })); } return(new YearlyRegeneratingPattern((int)recurrenceInterval, recurrenceData.CalendarType)); } throw new ConversionException("Unexpected recurrence type '" + type + "', should have been caught in a higher validation layer"); }
// Token: 0x06001214 RID: 4628 RVA: 0x00062188 File Offset: 0x00060388 public EntityRecurrenceProperty(TypeOfRecurrence typeOfRecurrence, int protocolVersion, EntityPropertyDefinition propertyDefinition, PropertyType type = PropertyType.ReadWrite) : base(propertyDefinition, type) { base.NestedData = new RecurrenceData(typeOfRecurrence, protocolVersion); }
public XsoRecurrenceProperty(TypeOfRecurrence recurrenceType, int protocolVersion) : base(new RecurrenceData(recurrenceType, protocolVersion)) { this.recurrenceType = recurrenceType; }