RecurrenceDay
Specifies the days of the week. Members might be combined using bitwise operations to specify multiple days.
The constants in the RecurrenceDay 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.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[Flags]
public enum RecurrenceDay
Example:
Consider the following example that demonstrates the basic usage pattern of RecurrenceDay. The most common operators used for manipulating bit fields are:
- Bitwise OR: Turns a flag on.
- Bitwise XOR: Toggles a flag.
- Bitwise AND: Checks if a flag is turned on.
- Bitwise NOT: Turns a flag off.
using System;
using Telerik.Web.UI;
namespace RecurrenceExamples
{
class RecurrenceDayExample
{
static void Main()
{
// Selects Friday, Saturday and Sunday.
RecurrenceDay dayMask = RecurrenceDay.Friday | RecurrenceDay.WeekendDays;
PrintSelectedDays(dayMask);
// Selects all days, except Thursday.
dayMask = RecurrenceDay.EveryDay ^ RecurrenceDay.Thursday;
PrintSelectedDays(dayMask);
}
static void PrintSelectedDays(RecurrenceDay 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.Web.UI
Namespace RecurrenceExamples
Class RecurrenceDayExample
Shared Sub Main()
' Selects Friday, Saturday and Sunday.
Dim dayMask As RecurrenceDay = RecurrenceDay.Friday Or RecurrenceDay.WeekendDays
PrintSelectedDays(dayMask)
' Selects all days, except Thursday.
dayMask = RecurrenceDay.EveryDay Xor RecurrenceDay.Thursday
PrintSelectedDays(dayMask)
End Sub
Shared Sub PrintSelectedDays(ByVal dayMask As RecurrenceDay)
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
'
Fields
Indicates the range from Sunday to Saturday inclusive.
EveryDay = WeekDays | WeekendDays
Indicates Saturday.
Friday = 32
Indicates Tuesday.
Monday = 2
Indicates no selected day.
None = 0
Indicates Sunday.
Saturday = 64
Indicates Monday.
Sunday = 1
Indicates Friday.
Thursday = 16
Indicates Wednesday.
Tuesday = 4
Indicates Thursday.
Wednesday = 8
Indicates the range from Monday to Friday inclusive.
WeekDays = Monday | Tuesday | Wednesday | Thursday | Friday
Indicates the range from Saturday to Sunday inclusive.
WeekendDays = Sunday | Saturday