New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

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:

C#
[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.
csharp
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
*/
csharp
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.

C#
EveryDay = WeekDays | WeekendDays

Indicates Saturday.

C#
Friday = 32

Indicates Tuesday.

C#
Monday = 2

Indicates no selected day.

C#
None = 0

Indicates Sunday.

C#
Saturday = 64

Indicates Monday.

C#
Sunday = 1

Indicates Friday.

C#
Thursday = 16

Indicates Wednesday.

C#
Tuesday = 4

Indicates Thursday.

C#
Wednesday = 8

Indicates the range from Monday to Friday inclusive.

C#
WeekDays = Monday | Tuesday | Wednesday | Thursday | Friday

Indicates the range from Saturday to Sunday inclusive.

C#
WeekendDays = Sunday | Saturday