• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class RecurrenceEvaluator

Evaluates a RecurrenceRule (RFC 5545 §3.3.10) to generate occurrence date-times. Given a rule and a start date-time (DTSTART), the evaluator produces the ordered set of date-times that satisfy the rule, bounded by COUNT, UNTIL, or an explicit range.

Inheritance
object
RecurrenceEvaluator
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Mail.Rfc.ICal
Assembly: DRIT.Mail.dll
Syntax
public static class RecurrenceEvaluator
Remarks

The evaluation follows the algorithm described in RFC 5545 §3.3.10. For each interval period (determined by FREQ and INTERVAL), candidate date-times are generated by applying the BY* rules in the order defined by the specification:

  1. BYMONTH
  2. BYWEEKNO
  3. BYYEARDAY
  4. BYMONTHDAY
  5. BYDAY
  6. BYHOUR
  7. BYMINUTE
  8. BYSECOND

After expansion, BYSETPOS selects specific positions within the period's candidate set. The result is filtered by UNTIL and limited by COUNT.

The first occurrence is always DTSTART itself, provided it falls within the bounds. Per RFC 5545 §3.3.10, the recurrence set is generated by considering the period containing DTSTART as the first period, even if DTSTART does not strictly match the BY* rules (DTSTART is always included as the first occurrence).

Fields

View Source

DefaultMaxOccurrences

The default maximum number of occurrences generated when neither COUNT, UNTIL, nor an explicit range bound the result. This guards against unbounded recurrence rules (e.g. FREQ=DAILY with no end).

Declaration
public const int DefaultMaxOccurrences = 1000
Field Value
Type Description
int
Remarks

The evaluation follows the algorithm described in RFC 5545 §3.3.10. For each interval period (determined by FREQ and INTERVAL), candidate date-times are generated by applying the BY* rules in the order defined by the specification:

  1. BYMONTH
  2. BYWEEKNO
  3. BYYEARDAY
  4. BYMONTHDAY
  5. BYDAY
  6. BYHOUR
  7. BYMINUTE
  8. BYSECOND

After expansion, BYSETPOS selects specific positions within the period's candidate set. The result is filtered by UNTIL and limited by COUNT.

The first occurrence is always DTSTART itself, provided it falls within the bounds. Per RFC 5545 §3.3.10, the recurrence set is generated by considering the period containing DTSTART as the first period, even if DTSTART does not strictly match the BY* rules (DTSTART is always included as the first occurrence).

Methods

View Source

Evaluate(RecurrenceRule, ICalDateTime)

Evaluates the specified recurrence rule starting from start, returning all occurrences. The result is bounded by COUNT or UNTIL if present in the rule; otherwise it is bounded by DefaultMaxOccurrences.

Declaration
public static IReadOnlyList<ICalDateTime> Evaluate(RecurrenceRule rule, ICalDateTime start)
Parameters
Type Name Description
RecurrenceRule rule

The recurrence rule to evaluate. Must not be null.

ICalDateTime start

The start date-time (DTSTART). Must not be null.

Returns
Type Description
IReadOnlyList<ICalDateTime>

An ordered list of occurrence date-times, starting with start.

Remarks

The evaluation follows the algorithm described in RFC 5545 §3.3.10. For each interval period (determined by FREQ and INTERVAL), candidate date-times are generated by applying the BY* rules in the order defined by the specification:

  1. BYMONTH
  2. BYWEEKNO
  3. BYYEARDAY
  4. BYMONTHDAY
  5. BYDAY
  6. BYHOUR
  7. BYMINUTE
  8. BYSECOND

After expansion, BYSETPOS selects specific positions within the period's candidate set. The result is filtered by UNTIL and limited by COUNT.

The first occurrence is always DTSTART itself, provided it falls within the bounds. Per RFC 5545 §3.3.10, the recurrence set is generated by considering the period containing DTSTART as the first period, even if DTSTART does not strictly match the BY* rules (DTSTART is always included as the first occurrence).

View Source

Evaluate(RecurrenceRule, ICalDateTime, ICalDateTime?, ICalDateTime?, int)

Evaluates the specified recurrence rule starting from start, returning all occurrences that fall within the range [rangeStart, rangeEnd]. The result is also bounded by COUNT or UNTIL if present in the rule.

Declaration
public static IReadOnlyList<ICalDateTime> Evaluate(RecurrenceRule rule, ICalDateTime start, ICalDateTime? rangeStart, ICalDateTime? rangeEnd, int maxOccurrences)
Parameters
Type Name Description
RecurrenceRule rule

Specifies the rule value.

ICalDateTime start

Specifies the start value.

ICalDateTime rangeStart

The inclusive lower bound of the range, or null for no lower bound. Occurrences before this bound are still counted toward COUNT but are not returned.

ICalDateTime rangeEnd

The inclusive upper bound of the range, or null for no upper bound (in which case maxOccurrences bounds the result).

int maxOccurrences

The maximum number of occurrences to generate, regardless of other bounds. This guards against unbounded rules.

Returns
Type Description
IReadOnlyList<ICalDateTime>

An ordered list of occurrence date-times within the specified range, starting with start if it falls within the range.

Remarks

The evaluation follows the algorithm described in RFC 5545 §3.3.10. For each interval period (determined by FREQ and INTERVAL), candidate date-times are generated by applying the BY* rules in the order defined by the specification:

  1. BYMONTH
  2. BYWEEKNO
  3. BYYEARDAY
  4. BYMONTHDAY
  5. BYDAY
  6. BYHOUR
  7. BYMINUTE
  8. BYSECOND

After expansion, BYSETPOS selects specific positions within the period's candidate set. The result is filtered by UNTIL and limited by COUNT.

The first occurrence is always DTSTART itself, provided it falls within the bounds. Per RFC 5545 §3.3.10, the recurrence set is generated by considering the period containing DTSTART as the first period, even if DTSTART does not strictly match the BY* rules (DTSTART is always included as the first occurrence).

  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX