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

Stores holidays for a scheduler, supports lookup by date, and can create all-day appointments for added holidays.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public class SchedulerHolidays : IEnumerable

Inheritance: objectSchedulerHolidays

Implements: IEnumerable

Constructors

Creates a holiday collection associated with the specified scheduler.

C#
public SchedulerHolidays(RadScheduler scheduler)
Parameters:schedulerRadScheduler

The scheduler whose appointment factory and collection are used when holiday appointments are requested.

Fields

Specifies the characters used to split date fields in HOL records; the default separator is /.

C#
protected char[] holidayDateSeparator

The resulting values are passed to the selected calendar as year, month, and day.

Specifies the character used to separate fields in a HOL record; the default delimiter is ,.

C#
protected char[] holidayLineSeparator

Methods

Add holiday to the holidays collection.

C#
public virtual void AddHoliday(Holiday holiday, bool createAppointment)
Parameters:holidayHoliday

the holiday object

createAppointmentbool

if true this will create an all day appointment

Add holiday to the holidays collection.

C#
public virtual void AddHolidays(IEnumerable<Holiday> holidays, bool createAppointment)
Parameters:holidaysIEnumerable<Holiday>

Collection with holidays

createAppointmentbool

if true this will create an all day appointment

Clear the Holidays collections. This does not affect already created appointments.

C#
public void Clear()

Get all location from the stream

C#
public List<string> GetAllLocations(Stream stream)
Parameters:streamStream

The input stream

Returns:

List<string>

List with the locations

The stream is disposed when this method returns.

Get all locations from the stream

C#
public List<string> GetAllLocations(string fileName)
Parameters:fileNamestring

The input file

Returns:

List<string>

List with the locations

Returns an enumerator over the stored holidays.

C#
public IEnumerator<Holiday> GetEnumerator()
Returns:

IEnumerator<Holiday>

An enumerator for the holiday collection.

Return all holidays for the specific date (if any)

C#
public virtual IEnumerable<Holiday> GetHolidays(DateTime dateTime)
Parameters:dateTimeDateTime

Date to check

Returns:

IEnumerable<Holiday>

The holidays on the specified date, or an empty sequence when there are no matches.

Check if the specific date is contained in the Holidays collection.

C#
public virtual bool IsHoliday(DateTime dateTime)
Parameters:dateTimeDateTime

Date to check.

Returns:

bool

true if holidays collection contains the date

Read the holidays information and create Holidays objects in the holidays collection only for holidays in the specific locations. Optionally can create also and all day appointments for the holidays.

C#
public void ReadHolidays(Stream stream, bool createAppointment, IEnumerable<string> locations)
Parameters:streamStream

The input stream containing HOL-formatted holiday data.

createAppointmentbool

If true this will be create an appointments for each holidays.

locationsIEnumerable<string>

Collection with locations.

The stream is disposed when this method returns.

Read the holidays information and create Holidays objects in the holidays collection. Optionally can create also and all day appointments for the holidays.

C#
public void ReadHolidays(Stream stream, bool createAppointment)
Parameters:streamStream

stream must be in HOL format.

createAppointmentbool

If true this will be create an appointments for each holidays.

The stream is disposed when this method returns.

Read the holidays information and create Holidays objects in the holidays collection only for holidays in the specific locations. Optionally can create also and all day appointments for the holidays.

C#
public void ReadHolidays(string fileName, bool createAppointment, IEnumerable<string> locations)
Parameters:fileNamestring

File name. File must be in HOL format.

createAppointmentbool

If true this will be create an appointments for each holidays.

locationsIEnumerable<string>

Collection with locations.

Read the holidays information and create Holidays objects in the holidays collection. Optionally can create also and all day appointments for the holidays.

C#
public void ReadHolidays(string fileName, bool createAppointment)
Parameters:fileNamestring

File name. File must be in HOL format.

createAppointmentbool

If true this will be create an appointments for each holidays.