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

Defines whether a resource's date and time interval counts as working or non-working time.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public class WorkTimeExceptionRule : INotifyPropertyChanged, INotifyPropertyChangingEx

Inheritance: objectWorkTimeExceptionRule

Implements: INotifyPropertyChangedINotifyPropertyChangingEx

Constructors

Initializes a rule with no resource or date limits, every weekday selected, and a zero-length time range. Set StartTime and EndTime before using the rule to match dates.

C#
public WorkTimeExceptionRule()

Properties

The time of day until which the rule is applied.

C#
public TimeSpan EndTime { get; set; }

The inclusive upper DateTime threshold for matching. If left null, there is no end limit.

C#
public DateTime? ExceptionEndDate { get; set; }

The inclusive lower DateTime threshold for matching. If left null, there is no start limit.

C#
public DateTime? ExceptionStartDate { get; set; }

Indicates whether the time interval described by the rule is considered a working time or non-working time.

C#
public bool IsWorkTime { get; set; }

The id of the resource this rule stands for. If left null, the rull will stand for all resources.

C#
public EventId ResourceId { get; set; }

The time of day after which the rule starts applying.

C#
public TimeSpan StartTime { get; set; }

The weekdays for which the rule applies. The default value is EveryDay. Days can be combined by using the WeekDays enum as flags.

C#
public WeekDays WeekDays { get; set; }

Methods

Raises PropertyChanged for a rule property that has changed.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring

The name of the changed property.

Matches a date when its resource and weekday match and its full DateTime value falls within the inclusive date thresholds and the time window. The time window includes StartTime and excludes EndTime; it does not cross midnight. On a match, isWorkTime receives IsWorkTime.

C#
public virtual bool TryMatchDate(DateTime date, EventId resourceId, out bool isWorkTime)
Parameters:dateDateTime

The date and time to test.

resourceIdEventId

The resource associated with the date.

isWorkTimebool

Receives the rule's working-time value on a match; receives false otherwise.

Returns:

bool

true if the rule applies to the date; otherwise, false.

Events

Occurs when a rule property changes.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged