Class DateTimeRange
- Namespace
- ArcanaDevelopment.adTempus.Shared
- Assembly
- ArcanaDevelopment.adTempus.Shared.dll
Represents a date/time range
[DataContract]
[KnownType(typeof(DateTimeOffset))]
public class DateTimeRange
- Inheritance
-
objectDateTimeRange
Constructors
DateTimeRange(DateTimeOffset, DateTimeOffset)
public DateTimeRange(DateTimeOffset startDateTime, DateTimeOffset endDateTime)
Parameters
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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:
ValueMeaning
Less than zero
This instance precedes
otherin the sort order.Zero
This instance occurs in the same position in the sort order as
other.Greater than zero
This instance follows
otherin 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
| Name | Type | Description |
|---|---|---|
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:
ValueMeaning
Less than zero
This instance precedes
objin the sort order.Zero
This instance occurs in the same position in the sort order as
obj.Greater than zero
This instance follows
objin the sort order.
Exceptions
- ArgumentException
objis not the same type as this instance.
Contains(DateTimeOffset)
Determines whether the range contains the specified value.
public bool Contains(DateTimeOffset valueToCheck)
Parameters
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
left |
DateTimeRange | |
right |
DateTimeRange |
Returns
- bool
operator >=(DateTimeRange, DateTimeRange)
public static bool operator >=(DateTimeRange left, DateTimeRange right)
Parameters
| Name | Type | Description |
|---|---|---|
left |
DateTimeRange | |
right |
DateTimeRange |
Returns
- bool
operator <(DateTimeRange, DateTimeRange)
public static bool operator <(DateTimeRange left, DateTimeRange right)
Parameters
| Name | Type | Description |
|---|---|---|
left |
DateTimeRange | |
right |
DateTimeRange |
Returns
- bool
operator <=(DateTimeRange, DateTimeRange)
public static bool operator <=(DateTimeRange left, DateTimeRange right)
Parameters
| Name | Type | Description |
|---|---|---|
left |
DateTimeRange | |
right |
DateTimeRange |
Returns
- bool