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

Represents a monthly recurrence rule.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

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

Inheritance: objectRecurrenceRuleWeeklyRecurrenceRuleMonthlyRecurrenceRule

Derived Classes: YearlyRecurrenceRule

Implements: ICloneableIEquatable<RecurrenceRule>INotifyPropertyChanged

Inherited Members WeeklyRecurrenceRule.DefaultOffsetWeeklyRecurrenceRule.MatchOffsetWeeklyRecurrenceRule.GetFirstDayOfWeek(DateTimeFormatInfo)WeeklyRecurrenceRule.MatchOffsetPositive(DateTime, DateTimeFormatInfo)WeeklyRecurrenceRule.MatchOffsetNegative(DateTime, DateTimeFormatInfo)WeeklyRecurrenceRule.MatchDayOfWeekMask(DateTime, Calendar)WeeklyRecurrenceRule.IncludeWeekDays(WeekDays)WeeklyRecurrenceRule.ExcludeWeekDays(WeekDays)WeeklyRecurrenceRule.AreWeekDaysIncluded(WeekDays)WeeklyRecurrenceRule.IntersectsWithException(DateTime, TimeSpan, IEvent)WeeklyRecurrenceRule.WeekDaysWeeklyRecurrenceRule.OffsetWeeklyRecurrenceRule.FirstDayOfWeekRecurrenceRule.DefaultEndDateRecurrenceRule.DefaultCountRecurrenceRule.CreateRule(RecurrenceType)RecurrenceRule.SuspendNotifications()RecurrenceRule.ResumeNotifications()RecurrenceRule.OnPropertyChanged(string)RecurrenceRule.IsExceptionDate(DateTime)RecurrenceRule.IsValid()RecurrenceRule.Equals(object)RecurrenceRule.GetHashCode()RecurrenceRule.ToString()RecurrenceRule.Clone()RecurrenceRule.ExceptionDatesRecurrenceRule.StartRecurrenceRule.EndRecurrenceRule.EventDurationRecurrenceRule.CountRecurrenceRule.IntervalRecurrenceRule.PropertyChanged...

Constructors

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule()

Initializes a new instance of the MonthlyRecurrenceRule class.

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

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

dayNumberint

The day number.

intervalint

The interval of the recurrence rule.

countint

The count.

Initializes a new instance of the MonthlyRecurrenceRule class.

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

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

dayNumberint

The day number.

intervalint

The interval of the recurrence rule.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, DateTime end, int weekNumber, WeekDays weekdays, int interval, int count)
Parameters:startDateTime

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

weekNumberint

The week number.

weekdaysWeekDays

The week days.

intervalint

The interval of the recurrence rule.

countint

The count.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, DateTime end, int weekNumber, WeekDays weekdays, int interval)
Parameters:startDateTime

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

weekNumberint

The week number.

weekdaysWeekDays

The week days.

intervalint

The interval of the recurrence rule.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, DateTime end, WeekDays weekdays, int offset, int interval, int count)
Parameters:startDateTime

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

weekdaysWeekDays

The week days.

offsetint

The offset.

intervalint

The interval of the recurrence rule.

countint

The count.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, DateTime end, WeekDays weekdays, int offset, int interval)
Parameters:startDateTime

The start of the recurrence rule.

endDateTime

The end of the recurrence rule.

weekdaysWeekDays

The week days.

offsetint

The offset.

intervalint

The interval of the recurrence rule.

Initializes a new instance of the MonthlyRecurrenceRule class.

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

The start of the recurrence rule.

dayNumberint

The day number.

intervalint

The interval of the recurrence rule.

countint

The count.

Initializes a new instance of the MonthlyRecurrenceRule class.

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

The start of the recurrence rule.

dayNumberint

The day number of the recurrence rule.

intervalint

The interval of the recurrence rule.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, int weekNumber, WeekDays weekdays, int interval, int count)
Parameters:startDateTime

The start of the recurrence rule.

weekNumberint

The week number.

weekdaysWeekDays

The week days.

intervalint

The interval of the recurrence rule.

countint

The count.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, int weekNumber, WeekDays weekdays, int interval)
Parameters:startDateTime

The start of the recurrence rule.

weekNumberint

The week number.

weekdaysWeekDays

The week days.

intervalint

The interval of the recurrence rule.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, WeekDays weekdays, int offset, int interval, int count)
Parameters:startDateTime

The start of the recurrence rule.

weekdaysWeekDays

The week days.

offsetint

The offset.

intervalint

The interval of the recurrence rule.

countint

The count.

Initializes a new instance of the MonthlyRecurrenceRule class.

C#
public MonthlyRecurrenceRule(DateTime start, WeekDays weekdays, int offset, int interval)
Parameters:startDateTime

The start of the recurrence rule.

weekdaysWeekDays

The week days.

offsetint

The offset.

intervalint

The interval of the recurrence rule.

Fields

The default day position; zero leaves day-of-month filtering unset.

C#
public static readonly int DefaultDayNumber

The default week position; zero leaves week-of-month filtering unset.

C#
public static readonly int DefaultWeekNumber

Properties

Gets or sets the day number.

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

The day number.

Gets the type of the recurrence rule.

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

The type of the recurrence rule.

Overrides: WeeklyRecurrenceRule.Frequency

Gets or sets the week number.

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

The week number.

Methods

Copies the base and weekly settings, plus the day-of-month and week-of-month positions. FirstDayOfWeek is not copied, and a nonzero inherited offset does not initialize its matcher.

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

The rule that receives the copied properties.

Overrides: WeeklyRecurrenceRule.CopyProperties(RecurrenceRule)

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

C#
protected override RecurrenceRule CreateInstance()
Returns:

RecurrenceRule

A new instance of the concrete recurrence-rule type.

Overrides: WeeklyRecurrenceRule.CreateInstance()

Compares the day and week positions, then the inherited weekly and shared recurrence settings. The inherited comparison does not include FirstDayOfWeek.

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

The rule to compare with this monthly rule.

Returns:

bool

true when the compared settings are equal; otherwise, false.

Overrides: WeeklyRecurrenceRule.Equals(RecurrenceRule)

Gets the last day of the candidate's month for negative weekday-offset calculations.

C#
protected override DateTime GetNegativeOffsetStart(DateTime date, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

A date in the month to inspect.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information used to find the month's end.

Returns:

DateTime

The last day of the month containing date.

Overrides: WeeklyRecurrenceRule.GetNegativeOffsetStart(DateTime, DateTimeFormatInfo)

Gets the occurrence start given an occurrence index.

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

The index.

startDateDateTime

The start date of the series.

dateTimeFormatDateTimeFormatInfo

The date time format.

Returns:

DateTime

Overrides: WeeklyRecurrenceRule.GetOccurrenceStart(int, DateTime, DateTimeFormatInfo)

Gets the first day of the candidate's month for positive weekday-offset calculations.

C#
protected override DateTime GetPositiveOffsetStart(DateTime date, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

A date in the month to inspect.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information.

Returns:

DateTime

The first day of the month containing date.

Overrides: WeeklyRecurrenceRule.GetPositiveOffsetStart(DateTime, DateTimeFormatInfo)

Checks the candidate against any configured week-of-month constraint and the weekday mask.

C#
protected override bool IsOffsetMatch(DateTime date, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

The candidate date to check.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information used for week calculations.

Returns:

bool

true when the candidate matches both applicable constraints; otherwise, false.

Overrides: WeeklyRecurrenceRule.IsOffsetMatch(DateTime, DateTimeFormatInfo)

Checks the month interval and any configured day-of-month, week-of-month, weekday-mask, and offset constraints.

C#
public override bool MatchAdvancedPattern(DateTime date, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

The candidate occurrence date.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information used for week calculations.

Returns:

bool

true when the candidate matches the monthly pattern; otherwise, false.

Overrides: WeeklyRecurrenceRule.MatchAdvancedPattern(DateTime, DateTimeFormatInfo)

Matches DayNumber from the beginning of the month when positive or from its end when negative.

C#
protected bool MatchDayOfMonth(DateTime date, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

The candidate date to check.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information used to find the month's end.

Returns:

bool

true when the candidate is at the configured day position; otherwise, false.

Compares the candidate's calendar week number with the configured position relative to startDate.

C#
protected bool MatchWeekOfMonth(DateTime date, DateTime startDate, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

The candidate date to check.

startDateDateTime

A date in the first or last week used as the position's reference.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information used to determine week numbers and week starts.

Returns:

bool

true when the candidate week matches the configured position; otherwise, false.

Matches WeekNumber relative to the first or last week of the candidate's month.

C#
protected bool MatchWeekOfMonth(DateTime date, DateTimeFormatInfo dateTimeFormat)
Parameters:dateDateTime

The candidate date to check.

dateTimeFormatDateTimeFormatInfo

Culture-specific calendar information used to determine week numbers.

Returns:

bool

true when the candidate is in the configured week; otherwise, false.

Skips to the first day of the next interval month after a match when no weekday mask is configured.

C#
public override bool TryGetCloseToNextOccurrenceDate(DateTime currentDate, bool hasOccurrenceOnCurrentDate, out DateTime closeToNextDate)
Parameters:currentDateDateTime

The candidate date currently being evaluated.

hasOccurrenceOnCurrentDatebool

true when the candidate matches the rule.

closeToNextDateDateTime

When returning true, receives the next candidate date with the same time of day.

Returns:

bool

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

Overrides: RecurrenceRule.TryGetCloseToNextOccurrenceDate(DateTime, bool, out DateTime)