protected virtual IList <Event> GetPatternRecurrenceExceptionsInWindow(Event master, ExDateTime windowStart, ExDateTime windowEnd) { List <Event> list = new List <Event>(); using (ICalendarItemBase calendarItemBase = this.Scope.EventDataProvider.BindToStoreObject(IdConverter.Instance.GetStoreId(master))) { CalendarItem calendarItem = calendarItemBase as CalendarItem; if (calendarItem != null && calendarItem.Recurrence != null) { IList <OccurrenceInfo> modifiedOccurrences = calendarItem.Recurrence.GetModifiedOccurrences(); foreach (OccurrenceInfo occurrenceInfo in modifiedOccurrences) { if (CalendarFolder.IsInWindow(windowStart, windowEnd, occurrenceInfo.StartTime, occurrenceInfo.EndTime)) { list.Add(this.Scope.Read(IdConverter.Instance.ToStringId(occurrenceInfo.VersionedId, this.Scope.Session), null)); } } } } return(list); }
protected virtual IList <string> GetDeletedOccurrenceIds(Event master, ExDateTime windowStart, ExDateTime windowEnd) { List <string> list = new List <string>(); StoreId storeId = IdConverter.Instance.GetStoreId(master); using (ICalendarItemBase calendarItemBase = this.Scope.EventDataProvider.BindToStoreObject(storeId)) { CalendarItem calendarItem = calendarItemBase as CalendarItem; if (calendarItem != null && calendarItem.Recurrence != null) { ExDateTime[] deletedOccurrences = calendarItem.Recurrence.GetDeletedOccurrences(); foreach (ExDateTime exDateTime in deletedOccurrences) { ExDateTime endTime = exDateTime.Add(master.End.Subtract(master.Start)); if (CalendarFolder.IsInWindow(windowStart, windowEnd, exDateTime, endTime)) { OccurrenceStoreObjectId storeId2 = new OccurrenceStoreObjectId(StoreId.GetStoreObjectId(storeId).ProviderLevelItemId, exDateTime); list.Add(IdConverter.Instance.ToStringId(storeId2, this.Scope.Session)); } } } } return(list); }
protected virtual bool IsInWindow(ExDateTime windowStart, ExDateTime windowEnd, Event instance) { return(CalendarFolder.IsInWindow(windowStart, windowEnd, instance.Start, instance.End)); }