RecurrenceDay Enumeration |
Specifies the days of the week. Members might be combined using bitwise operations to specify multiple days.
Namespace: Kettic.AspNet.Controls
Member name | Value | Description | |
---|---|---|---|
None | 0 | Indicates no selected day. | |
Sunday | 1 | Indicates Monday. | |
Monday | 2 | Indicates Tuesday. | |
Tuesday | 4 | Indicates Wednesday. | |
Wednesday | 8 | Indicates Thursday. | |
Thursday | 16 | Indicates Friday. | |
Friday | 32 | Indicates Saturday. | |
Saturday | 64 | Indicates Sunday. | |
EveryDay | 127 | Indicates the range from Sunday to Saturday inclusive. | |
WeekDays | 62 | Indicates the range from Monday to Friday inclusive. | |
WeekendDays | 65 | Indicates the range from Saturday to Sunday inclusive. |
Consider the following example that demonstrates the basic usage pattern of RecurrenceDay. The most common operators used for manipulating bit fields are:
using System; using Kettic.AspNet.Controls; 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 Kettic.AspNet.Controls 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 '
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.