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

Represents a time interval defined by two DateTime values.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
[TypeConverter(typeof(DateTimeIntervalConverter))]
public class DateTimeInterval : INotifyPropertyChanged, IEquatable<DateTimeInterval>, ICloneable

Inheritance: objectDateTimeInterval

Implements: ICloneableIEquatable<DateTimeInterval>INotifyPropertyChanged

Constructors

Initializes a new instance of the DateTimeInterval class.

C#
public DateTimeInterval()

Initializes a new instance of the DateTimeInterval class.

C#
public DateTimeInterval(DateTime start, DateTime end)
Parameters:startDateTime

The start of the interval.

endDateTime

The end of the interval.

Initializes a new instance of the DateTimeInterval class.

C#
public DateTimeInterval(DateTime start, TimeSpan duration)
Parameters:startDateTime

The start of the interval.

durationTimeSpan

The duration of the interval.

Properties

Gets or sets the duration of the interval.

C#
[Browsable(false)]
public virtual TimeSpan Duration { get; set; }
Property Value:

The duration of the interval.

Represents an empty DateTimeInterval value.

C#
public static DateTimeInterval Empty { get; }

Gets or sets the end of the interval.

C#
public virtual DateTime End { get; set; }
Property Value:

The end of the interval.

Gets or sets the start the start of the interval.

C#
public virtual DateTime Start { get; set; }
Property Value:

The start the interval.

Methods

C#
public virtual DateTimeInterval Clone()
Returns:

DateTimeInterval

Determines whether the specified date is contained in this interval.

C#
public bool Contains(DateTime date)
Parameters:dateDateTime

The date.

Returns:

bool

true if this interval contains the specified date; otherwise, false.

Determines whether this interval contains another interval.

C#
public bool Contains(DateTimeInterval other)
Parameters:otherDateTimeInterval

The other.

Returns:

bool

true if this inerval contains the other interval; otherwise, false.

C#
public bool Equals(DateTimeInterval other)
Parameters:otherDateTimeIntervalReturns:

bool

Implements: IEquatable<DateTimeInterval>.Equals(DateTimeInterval)

C#
public override bool Equals(object obj)
Parameters:objobjectReturns:

bool

Overrides: object.Equals(object)

C#
public override int GetHashCode()
Returns:

int

Overrides: object.GetHashCode()

Determines whether this interval intersects with the specified interval.

C#
public bool IntersectsWith(DateTimeInterval other)
Parameters:otherDateTimeInterval

The other interval.

Returns:

bool

Determines whether this interval intersects with the specified interval.

C#
public bool IntersectsWithGreaterEnd(DateTimeInterval other)
Parameters:otherDateTimeInterval

The other interval.

Returns:

bool

Determines whether the specified DateTimeInterval is null or empty.

C#
public static bool IsNullOrEmpty(DateTimeInterval interval)
Parameters:intervalDateTimeInterval

The interval.

Returns:

bool

true if the specified DateTimeInterval is null or empty; otherwise, false.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring
C#
public override string ToString()
Returns:

string

Overrides: object.ToString()

Events

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged