RecurrenceRule
Represents a base class that the actual recurrence rules extend.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.Scheduler.dll
Syntax:
public abstract class RecurrenceRule : INotifyPropertyChanged, ICloneable, IEquatable<RecurrenceRule>
Inheritance: objectRecurrenceRule
Derived Classes:
Implements:
Constructors
Initializes a new instance of the RecurrenceRule class.
public RecurrenceRule()
Initializes a new instance of the RecurrenceRule class.
Initializes a new instance of the RecurrenceRule class.
Initializes a new instance of the RecurrenceRule class.
Initializes a new instance of the RecurrenceRule class.
Fields
The default count used when a recurrence is not limited by an explicit occurrence count.
public static readonly int DefaultCount
The default date limit used when a recurrence has no configured end date.
public static readonly DateTime DefaultEndDate
Properties
Gets or sets the maximum number of occurrences.
public int Count { get; set; }
The count.
Gets or sets the end of the recurrence rule.
public DateTime End { get; set; }
The end.
Gets the durration of the recurring event.
public TimeSpan EventDuration { get; }
ExceptionDates
IList<DateTime>
Gets the date/time values used to exclude matching occurrence starts from recurrence processing.
public IList<DateTime> ExceptionDates { get; }
Gets the type of the recurrence rule.
public abstract RecurrenceType Frequency { get; }
The type of the recurrence rule.
Gets or sets the interval of the recurrence rule.
public int Interval { get; set; }
The interval.
Methods
Creates an independent instance of the concrete rule type, populated by its property-copy implementation with shared and frequency-specific settings.
Copies this rule's shared settings, exception dates, hour filters, and event duration to another rule. Derived rules should call this when copying their additional settings.
protected virtual void CopyProperties(RecurrenceRule other)
The rule that receives the copied properties.
Creates a new instance of the concrete rule type for use by Clone().
protected abstract RecurrenceRule CreateInstance()
A new instance of the concrete recurrence-rule type.
Creates a rule given its type.
public static RecurrenceRule CreateRule(RecurrenceType type)
The type of the recurrence rule.
Returns:Compares shared recurrence settings; concrete rule types also compare frequency-specific settings. Exception dates and event duration are not part of this comparison.
public virtual bool Equals(RecurrenceRule other)
The recurrence rule to compare with this instance.
Returns:Implements:
Returns the base object hash code rather than a hash derived from recurrence settings. Consequently, equal rules are not guaranteed to have equal hash codes.
public override int GetHashCode()
The hash code produced by the base implementation.
Overrides:
Gets a date at a given index after the specified startDate. The returned date will be checked with MatchAdvancedPattern to see if it matches the recurrence rule. NOTE: The returned date is not an actual occurence start. To get the start date of a real occurrence use OccurrenceEnumerator.
public abstract DateTime GetOccurrenceStart(int index, DateTime startDate, DateTimeFormatInfo dateTimeFormat)
The index after the suggested date.
startDateDateTimeThe suggested start date.
dateTimeFormatDateTimeFormatInfoThe date time format.
Returns:A potential occurrence start which should be checked if it matches the pattern.
Determines whether an exception event suppresses the candidate occurrence under this rule's frequency-specific matching.
public abstract bool IntersectsWithException(DateTime eventStart, TimeSpan eventDuration, IEvent exception)
The candidate occurrence start.
eventDurationTimeSpanThe candidate occurrence duration.
exceptionIEventThe exception event to compare with the candidate.
Returns:true when the exception suppresses the occurrence; otherwise, false.
Applies additional recurrence-pattern checks to a candidate date; the base implementation filters configured hours.
public virtual bool MatchAdvancedPattern(DateTime start, DateTimeFormatInfo dateTimeFormat)
The candidate occurrence start produced by GetOccurrenceStart(int, DateTime, DateTimeFormatInfo).
dateTimeFormatDateTimeFormatInfoCulture-specific date information used by derived pattern checks.
Returns:true when the candidate satisfies the advanced pattern; otherwise, false.
Raises PropertyChanged for a changed rule property unless notifications are suspended.
protected virtual void OnPropertyChanged(string propertyName)
The name of the changed property.
Releases one notification suspension; notifications resume when the suspension count reaches zero.
public virtual void ResumeNotifications()
Suppresses property-change notifications until matching resume calls release all nested suspensions.
public virtual void SuspendNotifications()
Converts the recurrence rule to its iCalendar text representation.
public override string ToString()
The serialized recurrence rule, including its date and exception information.
Overrides:
Lets a derived rule skip candidate dates and move the enumerator closer to its next possible occurrence.
public virtual bool TryGetCloseToNextOccurrenceDate(DateTime currentDate, bool hasOcurrenceOnCurrentDate, out DateTime closeToNextDate)
The candidate date currently being evaluated.
hasOcurrenceOnCurrentDateboolWhether the rule matches the current candidate date.
closeToNextDateDateTimeWhen this method returns true, receives the next candidate date to evaluate.
Returns:Events
Occurs when a recurrence setting or exception-date collection changes, unless notifications are suspended.
public event PropertyChangedEventHandler PropertyChanged
Implements: