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

Compares appointment elements by start time, or by end time when compareByEndValue is enabled. The constructors select ascending or descending order, and a supplied scheduler can provide tie-breaking.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public class DateTimeComparer

Inheritance: objectDateTimeComparer

Constructors

Initializes a new instance of the DateTimeComparer class.

C#
public DateTimeComparer(bool descending)
Parameters:descendingbool

if set to true [descending].

Initializes a comparer associated with the specified scheduler and sort direction.

C#
public DateTimeComparer(RadScheduler scheduler, bool descending)
Parameters:schedulerRadScheduler

The scheduler whose optional appointment comparer can break ties.

descendingbool

true to reverse the comparison order; otherwise, use ascending order.

Initializes an ascending start-time comparer associated with the specified scheduler.

C#
public DateTimeComparer(RadScheduler scheduler)
Parameters:schedulerRadScheduler

The scheduler whose optional appointment comparer can break ties.

Fields

Specifies whether comparisons use appointment end times instead of start times.

C#
public bool compareByEndValue

Methods

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

C#
public int Compare(AppointmentElement x, AppointmentElement y)
Parameters:xAppointmentElement

The first object to compare.

yAppointmentElement

The second object to compare.

Returns:

int

Value Condition Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y.