New to Telerik UI for WPF? 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 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.

Definition

Namespace:Telerik.Windows.Controls.ScheduleView

Assembly:Telerik.Windows.Controls.ScheduleView.dll

Syntax:

C#
[Flags]
public enum RecurrenceDays

Example:

Consider the following example that demonstrates the basic usage pattern of RecurrenceDays. 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.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
*/
csharp
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
'

.

Fields

Indicates the range from Sunday to Saturday inclusive.

C#
EveryDay = WeekDays | WeekendDays

Indicates Friday.

C#
Friday = 32

Indicates Monday.

C#
Monday = 2

Indicates no selected day.

C#
None = 0

Indicates Saturday.

C#
Saturday = 64

Indicates Sunday.

C#
Sunday = 1

Indicates Thursday.

C#
Thursday = 16

Indicates Tuesday.

C#
Tuesday = 4

Indicates Wednesday.

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

Extension Methods