RecurrencePattern
Provides the class for recurrence pattern.
Definition
Namespace:Telerik.Windows.Controls.ScheduleView
Assembly:Telerik.Windows.Controls.dll
Syntax:
public class RecurrencePattern : ViewModelBase, INotifyPropertyChanged, IDisposable
Inheritance: objectViewModelBaseRecurrencePattern
Implements:
Inherited Members
Constructors
Initializes a new instance of the RecurrencePattern class.
public RecurrencePattern()
Initializes a new instance of the RecurrencePattern class.
public RecurrencePattern(CultureInfo culture)
The Culture to use when generating dates. By default the class uses InvariantCulture.
Initializes a new instance of the RecurrencePattern class.
public RecurrencePattern(int? dayOfMonth, RecurrenceDays daysOfWeekMask, RecurrenceFrequency frequency, int interval, int? monthOfYear, int? dayOrdinal)
The day of month.
daysOfWeekMaskRecurrenceDaysThe days of week mask.
frequencyRecurrenceFrequencyThe frequency.
intervalintThe interval.
monthOfYearint?The month of year.
dayOrdinalint?The week of month.
Initializes a new instance of the RecurrencePattern class.
public RecurrencePattern(int[] daysOfMonth, RecurrenceDays daysOfWeekMask, RecurrenceFrequency frequency, int interval, int[] monthsOfYear, int? dayOrdinal, int[] hoursOfDay, int[] minutesOfHour)
The days of month.
daysOfWeekMaskRecurrenceDaysThe days of week mask.
frequencyRecurrenceFrequencyThe frequency.
intervalintThe interval.
monthsOfYearint[]The months of year.
dayOrdinalint?The week of month.
hoursOfDayint[]The hours of day.
minutesOfHourint[]The minutes of hour.
Properties
Gets or sets the day ordinal.
public int? DayOrdinal { get; set; }
The day ordinal.
Gets or sets the day of month.
public int[] DaysOfMonth { get; set; }
The days of month.
Gets or sets the days of week mask.
public RecurrenceDays DaysOfWeekMask { get; set; }
The days of week mask.
Gets or sets the day on which the week starts.
public DayOfWeek FirstDayOfWeek { get; set; }
This property is only meaningful when RecurrenceFrequency is set to Weekly and Interval is greater than 1.
Gets or sets the frequency.
public RecurrenceFrequency Frequency { get; set; }
The frequency.
Gets or sets the hours of day.
public int[] HoursOfDay { get; set; }
The hours of day.
Gets or sets the interval.
public int Interval { get; set; }
The interval.
Optional limit for the number of occurrences. Defaults to no limit (Int32.MaxInt).
public int? MaxOccurrences { get; set; }
Gets or sets the minutes of hour.
public int[] MinutesOfHour { get; set; }
The minutes of hour.
Gets or sets the month of year.
public int? MonthOfYear { get; set; }
The month of year.
Optional end date for the recurring appointment. Defaults to no end date (DateTime.MaxValue).
public DateTime? RecursUntil { get; set; }
The recurs until.
Methods
Deep copies this instance.
Copies from.
public void CopyFrom(RecurrencePattern other)
The other.
Exceptions: ArgumentExceptionInvalid type.
Gets the occurrences in the inclusive date range from from through to.
public IEnumerable<DateTime> GetFiniteOccurrences(DateTime start, DateTime from, DateTime to)
The starting date and time of the series.
fromDateTimeThe earliest date and time to include.
toDateTimeThe latest date and time to include.
Returns:The occurrence start dates and times in the requested range.
Exceptions: ArgumentExceptionThe pattern is invalid or to precedes from.
The series cannot reach its configured occurrence count before the supported date range ends.
Gets the date and time at the specified recurrence index for time-based patterns.
protected DateTime GetNextDate(DateTime start, int index)
The starting date and time of the series.
indexintThe zero-based recurrence index.
Returns:The date and time at the requested index.
Exceptions: ArgumentExceptionThe frequency is not supported by this operation.
Gets the occurrences.
public IEnumerable<DateTime> GetOccurrences(DateTime start)
The start.
Returns:Determines whether a date's weekday is included in a weekday mask.
protected static bool MatchDayOfWeekMask(DateTime start, RecurrenceDays daysOfWeekMask)
The date to evaluate.
daysOfWeekMaskRecurrenceDaysThe weekday mask to test.
Returns:true if daysOfWeekMask is empty or includes the date's weekday; otherwise, false.
Determines whether a date is the specified ordinal occurrence of the selected weekdays in its month.
protected static bool MatchDayOrdinal(DateTime date, int? dayOrdinal, RecurrenceDays daysOfWeekMask, CultureInfo culture = null)
The date to evaluate.
dayOrdinalint?The occurrence ordinal from 1 through 4, -1 for the last occurrence, or null to skip ordinal filtering.
daysOfWeekMaskRecurrenceDaysThe weekday mask to test.
cultureCultureInfoThe culture whose calendar is used; or null to use the invariant culture.
Returns:true if the date matches the ordinal filter; otherwise, false.
Determines whether a date and time satisfies this pattern relative to the series start.
Validates that this pattern defines a finite daily, weekly, monthly, or yearly recurrence.
public void ValidateFinite(DateTime start)
The starting date and time of the series.
Exceptions: ArgumentExceptionThe frequency, filters, calendar, or end condition is invalid.
ArgumentOutOfRangeExceptionInterval is not positive.