New to Telerik UI for WPFStart a free 30-day trial

Extension methods for IDateSpan interface.

Definition

Namespace:Telerik.Windows.Controls.ScheduleView

Assembly:Telerik.Windows.Controls.ScheduleView.dll

Syntax:

C#
public static class DateSpanExtensions

Inheritance: objectDateSpanExtensions

Methods

Determines whether DateSpan contains DateTime.

C#
public static bool Contains(this IDateSpan source, DateTime date)
Parameters:sourceIDateSpan

The source.

dateDateTime

The date.

Returns:

bool

true if contains date; otherwise, false.

Determines whether DateSpan contains another DateSpan.

C#
public static bool Contains(this IDateSpan source, IDateSpan other)
Parameters:sourceIDateSpan

The source.

otherIDateSpan

The other.

Returns:

bool

true if contains another DateSpan; otherwise, false.

Gets the duration of the specified date span.

C#
public static TimeSpan Duration(this IDateSpan dateSpan)
Parameters:dateSpanIDateSpan

The date span.

Returns:

TimeSpan

Duration of the date span as distinction of end and start.

Checks whether do two spans intersect with each other or not.

C#
public static bool IntersectsWith(this IDateSpan source, IDateSpan other)
Parameters:sourceIDateSpan

The source.

otherIDateSpan

The other.

Returns:

bool

Translates a DateSpan with a specified TimeSpan.

C#
public static DateSpan Translate(this IDateSpan dateSpan, TimeSpan span)
Parameters:dateSpanIDateSpan

The DateSpan to be translated.

spanTimeSpan

The TimeSpan the DateSpan to be translated with.

Returns:

DateSpan

The translated DateSpan. If we translate "2010/05/05 15:30 - 2010/05/06 15:00" with 03:00 the result will be "2010/05/05 18:30 - 2010/05/06 18:00".

Validates the specified date span.

C#
public static bool Validate(this IDateSpan dateSpan)
Parameters:dateSpanIDateSpan

The date span.

Returns:

bool