OccurrenceEnumerator
Enumerates occurrences generated by an event's recurrence rule, optionally bounded by inclusive start-time limits. This object is both the enumerable and its enumerator; create a new instance for each independent pass.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.Scheduler.dll
Syntax:
public class OccurrenceEnumerator : IDisposable, IEnumerator, IEnumerable
Inheritance: objectOccurrenceEnumerator
Implements:
Constructors
Creates a range-limited enumerator that can optionally include occurrences covered by exception events or dates.
public OccurrenceEnumerator(IEvent recurringEvent, DateTimeFormatInfo dateTimeFormat, DateTime from, DateTime to, bool checkExceptions)
The event whose recurrence rule is enumerated.
dateTimeFormatDateTimeFormatInfoDate information used when calculating occurrences; null uses the current culture.
fromDateTimeThe earliest included occurrence start time.
toDateTimeThe latest included occurrence start time.
checkExceptionsboolCreates an enumerator limited to occurrence start times within the specified inclusive range.
public OccurrenceEnumerator(IEvent recurringEvent, DateTimeFormatInfo dateTimeFormat, DateTime from, DateTime to)
The event whose recurrence rule is enumerated.
dateTimeFormatDateTimeFormatInfoDate information used when calculating occurrences; null uses the current culture.
fromDateTimeThe earliest included occurrence start time.
toDateTimeThe latest included occurrence start time.
Creates an enumerator using the supplied culture-specific date information.
public OccurrenceEnumerator(IEvent recurringEvent, DateTimeFormatInfo dateTimeFormat)
The event whose recurrence rule is enumerated.
dateTimeFormatDateTimeFormatInfoDate information used when calculating occurrences; null uses the current culture.
Creates an enumerator for all occurrences of the event's recurrence rule.
public OccurrenceEnumerator(IEvent recurringEvent)
The event whose recurrence rule is enumerated.
Fields
The start time used by Current to create the current occurrence.
protected DateTime? currentOccurrenceStart
The index used to request the next candidate from the recurrence rule.
protected int occurrenceIndex
The number of candidates that matched the recurrence pattern so far.
protected int occurrencesCount
The date from which candidate dates are generated; rule-specific skipping can advance it.
protected DateTime? occurrenceStartDate
The recurring event whose rule supplies candidate occurrences.
protected IEvent recurringEvent
Properties
Gets a newly created event instance when the enumerator is positioned on an occurrence.
public virtual IEvent Current { get; }
No current occurrence start has been set.
Gets or sets the culture-specific date information used to calculate recurrence patterns. Assigning null restores the current culture's date format.
public virtual DateTimeFormatInfo CurrentDateTimeFormat { get; set; }
Methods
Resets the enumerator's position and counters.
public void Dispose()
Implements:
Returns this instance as the enumerator; it is not reset automatically for another pass.
public IEnumerator<IEvent> GetEnumerator()
IEnumerator<IEvent>
This occurrence enumerator.
Returns a single-pass enumerable of occurrences within the inclusive range, with control over exception filtering.
public static IEnumerable<IEvent> GetOccurrences(IEvent appointment, DateTime from, DateTime to, bool checkExceptions)
The recurring event to enumerate; null produces no occurrences.
fromDateTimeThe earliest included occurrence start time.
toDateTimeThe latest included occurrence start time.
checkExceptionsboolReturns:IEnumerable<IEvent>
An enumerable backed by an OccurrenceEnumerator instance.
Returns a single-pass enumerable of occurrences whose start times fall within the inclusive range. Exception occurrences are skipped.
public static IEnumerable<IEvent> GetOccurrences(IEvent appointment, DateTime from, DateTime to)
The recurring event to enumerate; null produces no occurrences.
fromDateTimeThe earliest included occurrence start time.
toDateTimeThe latest included occurrence start time.
Returns:IEnumerable<IEvent>
An enumerable backed by an OccurrenceEnumerator instance.
Advances to the next occurrence, optionally converting its start time before applying the configured range limits.
public virtual bool MoveNext(SchedulerTimeZone system, SchedulerTimeZone active)
The source time zone for conversion; conversion is skipped unless active is also supplied.
The target time zone used to convert occurrence start times for range checks.
Returns:Returns the enumeration to its initial position while retaining its date range and date format.
public virtual void Reset()
Implements: