Enum RecurrenceDays
Specifies the days of the week. Members might be combined using bitwise operations to specify multiple days.
Namespace: Telerik.Windows.Controls.ScheduleView
Assembly: Telerik.Windows.Controls.ScheduleView.dll
Syntax
[Flags]
public enum RecurrenceDays
Remarks
The constants in the RecurrenceDays enumeration might be combined with bitwise operations to represent any combination of days. It is designed to be used in conjunction with the RecurrencePattern class to filter the days of the week for which the recurrence pattern applies.
Examples
Consider the following example that demonstrates the basic usage pattern of RecurrenceDays. The most common operators used for manipulating bit fields are:
using System;
using Telerik.Windows.Controls.ScheduleView;
namespace RecurrenceExamples
{
class RecurrenceDayExample
{
static void Main()
{
// Selects Friday, Saturday and Sunday.
RecurrenceDays dayMask = RecurrenceDays.Friday | RecurrenceDays.WeekendDays;
PrintSelectedDays(dayMask);
// Selects all days, except Thursday.
dayMask = RecurrenceDays.EveryDay ^ RecurrenceDays.Thursday;
PrintSelectedDays(dayMask);
}
static void PrintSelectedDays(RecurrenceDays dayMask)
{
Console.WriteLine("Value: {0,3} - {1}", (int) dayMask, dayMask);
}
}
}
/*
This example produces the following results:
Value: 112 - Friday, WeekendDays
Value: 119 - Monday, Tuesday, Wednesday, Friday, WeekendDays
*/
Imports System
Imports Telerik.Windows.Controls.ScheduleView
Namespace RecurrenceExamples
Class RecurrenceDayExample
Shared Sub Main()
' Selects Friday, Saturday and Sunday.
Dim dayMask As RecurrenceDays = RecurrenceDays.Friday Or RecurrenceDays.WeekendDays
PrintSelectedDays(dayMask)
' Selects all days, except Thursday.
dayMask = RecurrenceDays.EveryDay Xor RecurrenceDays.Thursday
PrintSelectedDays(dayMask)
End Sub
Shared Sub PrintSelectedDays(ByVal dayMask As RecurrenceDays)
Console.WriteLine("Value: {0,3} - {1}", DirectCast(dayMask, Integer), dayMask)
End Sub
End Class
End Namespace
'
'This example produces the following results:
'
'Value: 112 - Friday, WeekendDays
'Value: 119 - Monday, Tuesday, Wednesday, Friday, WeekendDays
'
.
EveryDay
Indicates the range from Sunday to Saturday inclusive.
Friday
Indicates Friday.
Monday
Indicates Monday.
None
Indicates no selected day.
Saturday
Indicates Saturday.
Sunday
Indicates Sunday.
Thursday
Indicates Thursday.
Tuesday
Indicates Tuesday.
Wednesday
Indicates Wednesday.
WeekDays
Indicates the range from Monday to Friday inclusive.
WeekendDays
Indicates the range from Saturday to Sunday inclusive.