New to Telerik UI for WinForms? Start a free 30-day trial

Converts between DayOfWeek values and the bit flags used by weekly recurrence rules.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public static class WeekDaysHelper

Inheritance: objectWeekDaysHelper

Methods

Determines whether the original mask contains all flags in the specified mask.

C#
public static bool AreWeekDaysIncluded(WeekDays original, WeekDays other)
Parameters:originalWeekDays

The weekday mask being checked.

otherWeekDays

The flags that must be present.

Returns:

bool

true when every flag in other is set in original; otherwise, false.

Toggles the specified weekday flags in the existing mask. Flags that are absent from original are added rather than ignored.

C#
public static WeekDays ExcludeWeekDays(WeekDays original, WeekDays other)
Parameters:originalWeekDays

The existing weekday mask.

otherWeekDays

The flags to toggle.

Returns:

WeekDays

The mask after the specified flags are toggled.

Converts a DayOfWeek value to its corresponding WeekDays flag.

C#
public static WeekDays FromDayOfWeek(DayOfWeek dayOfWeek)
Parameters:dayOfWeekDayOfWeek

The day to convert.

Returns:

WeekDays

The corresponding single-day flag, or None if the value is not a defined day.

Combines the existing weekday flags with the specified flags.

C#
public static WeekDays IncludeWeekDays(WeekDays original, WeekDays other)
Parameters:originalWeekDays

The existing weekday mask.

otherWeekDays

The flags to add to the mask.

Returns:

WeekDays

The union of both weekday masks.

Determines whether the mask includes the flag corresponding to the specified day.

C#
public static bool IsDayOfWeekIncluded(WeekDays weekdays, DayOfWeek dayOfWeek)
Parameters:weekdaysWeekDays

The weekday mask to check.

dayOfWeekDayOfWeek

The day whose corresponding flag is checked.

Returns:

bool

true when the corresponding flag is included; otherwise, false.

Converts a single weekday flag to the corresponding DayOfWeek.

C#
public static DayOfWeek ToDayOfWeek(WeekDays weekdays)
Parameters:weekdaysWeekDays

Exactly one individual weekday flag; combined masks and named groups are not accepted.

Returns:

DayOfWeek

The corresponding day of the week.

Exceptions: ArgumentException

The value is not one individual weekday flag.