New to Telerik UI for WinForms? Start a free 30-day trial

Represents a base class that the actual recurrence rules extend.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public abstract class RecurrenceRule : INotifyPropertyChanged, ICloneable, IEquatable<RecurrenceRule>

Inheritance: objectRecurrenceRule

Derived Classes: DailyRecurrenceRuleHourlyRecurrenceRuleMinutelyRecurrenceRuleWeeklyRecurrenceRule

Implements: ICloneableIEquatable<RecurrenceRule>INotifyPropertyChanged

Constructors

Initializes a new instance of the RecurrenceRule class.

C#
public RecurrenceRule()

Initializes a new instance of the RecurrenceRule class.

C#
public RecurrenceRule(DateTime start, DateTime end, int interval, int count)
Parameters:startDateTime

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

intervalint

The interval of the recurrence rule.

countint

The maximum number of occurrences.

Initializes a new instance of the RecurrenceRule class.

C#
public RecurrenceRule(DateTime start, DateTime end, int interval)
Parameters:startDateTime

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

intervalint

The interval.

Initializes a new instance of the RecurrenceRule class.

C#
public RecurrenceRule(DateTime start, int interval, int count)
Parameters:startDateTime

The start of the recurrence rule.

intervalint

The interval of the recurrence rule.

countint

The maximum number of occurrences.

Initializes a new instance of the RecurrenceRule class.

C#
public RecurrenceRule(DateTime start, int interval)
Parameters:startDateTime

The start of the recurrence rule.

intervalint

The interval of the recurrence rule.

Fields

The default count used when a recurrence is not limited by an explicit occurrence count.

C#
public static readonly int DefaultCount

The default date limit used when a recurrence has no configured end date.

C#
public static readonly DateTime DefaultEndDate

Properties

Gets or sets the maximum number of occurrences.

C#
public int Count { get; set; }
Property Value:

The count.

Gets or sets the end of the recurrence rule.

C#
public DateTime End { get; set; }
Property Value:

The end.

Gets the durration of the recurring event.

C#
public TimeSpan EventDuration { get; }

Gets the date/time values used to exclude matching occurrence starts from recurrence processing.

C#
public IList<DateTime> ExceptionDates { get; }

Gets the type of the recurrence rule.

C#
public abstract RecurrenceType Frequency { get; }
Property Value:

The type of the recurrence rule.

Gets or sets the interval of the recurrence rule.

C#
public int Interval { get; set; }
Property Value:

The interval.

Gets or sets the start of the recurrence rule.

C#
public DateTime? Start { get; set; }
Property Value:

The start.

Methods

Creates an independent instance of the concrete rule type, populated by its property-copy implementation with shared and frequency-specific settings.

C#
public RecurrenceRule Clone()
Returns:

RecurrenceRule

A cloned recurrence rule.

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.

C#
protected virtual void CopyProperties(RecurrenceRule other)
Parameters:otherRecurrenceRule

The rule that receives the copied properties.

Creates a new instance of the concrete rule type for use by Clone().

C#
protected abstract RecurrenceRule CreateInstance()
Returns:

RecurrenceRule

A new instance of the concrete recurrence-rule type.

Creates a rule given its type.

C#
public static RecurrenceRule CreateRule(RecurrenceType type)
Parameters:typeRecurrenceType

The type of the recurrence rule.

Returns:

RecurrenceRule

Compares this rule with another recurrence rule using the concrete rule's equality implementation.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this rule.

Returns:

bool

true when obj is an equal recurrence rule; otherwise, false.

Overrides: object.Equals(object)

Compares shared recurrence settings; concrete rule types also compare frequency-specific settings. Exception dates and event duration are not part of this comparison.

C#
public virtual bool Equals(RecurrenceRule other)
Parameters:otherRecurrenceRule

The recurrence rule to compare with this instance.

Returns:

bool

true when the rules are equal; otherwise, false.

Implements: IEquatable<RecurrenceRule>.Equals(RecurrenceRule)

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.

C#
public override int GetHashCode()
Returns:

int

The hash code produced by the base implementation.

Overrides: object.GetHashCode()

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.

C#
public abstract DateTime GetOccurrenceStart(int index, DateTime startDate, DateTimeFormatInfo dateTimeFormat)
Parameters:indexint

The index after the suggested date.

startDateDateTime

The suggested start date.

dateTimeFormatDateTimeFormatInfo

The date time format.

Returns:

DateTime

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.

C#
public abstract bool IntersectsWithException(DateTime eventStart, TimeSpan eventDuration, IEvent exception)
Parameters:eventStartDateTime

The candidate occurrence start.

eventDurationTimeSpan

The candidate occurrence duration.

exceptionIEvent

The exception event to compare with the candidate.

Returns:

bool

true when the exception suppresses the occurrence; otherwise, false.

Checks if there is an occurrence exception on the specified date.

C#
public virtual bool IsExceptionDate(DateTime date)
Parameters:dateDateTime

The date to check for exceptions.

Returns:

bool

[true] if there is an exception on that date, [false] otherwise

Checks the base constraints that the occurrence count is nonnegative and the interval is at least one.

C#
public virtual bool IsValid()
Returns:

bool

true when the base recurrence constraints are valid; otherwise, false.

Applies additional recurrence-pattern checks to a candidate date; the base implementation filters configured hours.

C#
public virtual bool MatchAdvancedPattern(DateTime start, DateTimeFormatInfo dateTimeFormat)
Parameters:startDateTime

The candidate occurrence start produced by GetOccurrenceStart(int, DateTime, DateTimeFormatInfo).

dateTimeFormatDateTimeFormatInfo

Culture-specific date information used by derived pattern checks.

Returns:

bool

true when the candidate satisfies the advanced pattern; otherwise, false.

Raises PropertyChanged for a changed rule property unless notifications are suspended.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring

The name of the changed property.

Releases one notification suspension; notifications resume when the suspension count reaches zero.

C#
public virtual void ResumeNotifications()

Suppresses property-change notifications until matching resume calls release all nested suspensions.

C#
public virtual void SuspendNotifications()

Converts the recurrence rule to its iCalendar text representation.

C#
public override string ToString()
Returns:

string

The serialized recurrence rule, including its date and exception information.

Overrides: object.ToString()

Lets a derived rule skip candidate dates and move the enumerator closer to its next possible occurrence.

C#
public virtual bool TryGetCloseToNextOccurrenceDate(DateTime currentDate, bool hasOcurrenceOnCurrentDate, out DateTime closeToNextDate)
Parameters:currentDateDateTime

The candidate date currently being evaluated.

hasOcurrenceOnCurrentDatebool

Whether the rule matches the current candidate date.

closeToNextDateDateTime

When this method returns true, receives the next candidate date to evaluate.

Returns:

bool

true when the enumerator can skip ahead; otherwise, false.

Events

Occurs when a recurrence setting or exception-date collection changes, unless notifications are suspended.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged