Table of Contents

Class DateTimeRange

Namespace
ArcanaDevelopment.adTempus.Shared
Assembly
ArcanaDevelopment.adTempus.Shared.dll

Represents a date/time range

[DataContract]
[KnownType(typeof(DateTimeOffset))]
public class DateTimeRange
Inheritance
object
DateTimeRange

Constructors

DateTimeRange(DateTimeOffset, DateTimeOffset)

public DateTimeRange(DateTimeOffset startDateTime, DateTimeOffset endDateTime)

Parameters

NameTypeDescription
startDateTime DateTimeOffset
endDateTime DateTimeOffset

Fields

End

[DataMember]
public readonly DateTimeOffset End

Field Value

DateTimeOffset

Start

[DataMember]
public readonly DateTimeOffset Start

Field Value

DateTimeOffset

Methods

CompareTo(DateTimeRange)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(DateTimeRange other)

Parameters

NameTypeDescription
other DateTimeRange

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value

Meaning

Less than zero

This instance precedes other in the sort order.

Zero

This instance occurs in the same position in the sort order as other.

Greater than zero

This instance follows other in the sort order.

CompareTo(object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(object obj)

Parameters

NameTypeDescription
obj object

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value

Meaning

Less than zero

This instance precedes obj in the sort order.

Zero

This instance occurs in the same position in the sort order as obj.

Greater than zero

This instance follows obj in the sort order.

Exceptions

ArgumentException

obj is not the same type as this instance.

Contains(DateTimeOffset)

Determines whether the range contains the specified value.

public bool Contains(DateTimeOffset valueToCheck)

Parameters

NameTypeDescription
valueToCheck DateTimeOffset

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator >(DateTimeRange, DateTimeRange)

public static bool operator >(DateTimeRange left, DateTimeRange right)

Parameters

NameTypeDescription
left DateTimeRange
right DateTimeRange

Returns

bool

operator >=(DateTimeRange, DateTimeRange)

public static bool operator >=(DateTimeRange left, DateTimeRange right)

Parameters

NameTypeDescription
left DateTimeRange
right DateTimeRange

Returns

bool

operator <(DateTimeRange, DateTimeRange)

public static bool operator <(DateTimeRange left, DateTimeRange right)

Parameters

NameTypeDescription
left DateTimeRange
right DateTimeRange

Returns

bool

operator <=(DateTimeRange, DateTimeRange)

public static bool operator <=(DateTimeRange left, DateTimeRange right)

Parameters

NameTypeDescription
left DateTimeRange
right DateTimeRange

Returns

bool