Struct TimeRange
Represents a period of time between two System.DateTime values.
Implements
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public struct TimeRange : IEquatable<TimeRange>
Constructors
| Improve this DocTimeRange(DateTime, DateTime)
Initializes a new instance of the TimeRange struct.
Declaration
public TimeRange(DateTime start, DateTime end)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | start | The start date of a time range. |
System.DateTime | end | The end date of a time range. |
Properties
| Improve this DocDuration
Declaration
public TimeSpan Duration { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan | A System.TimeSpan representing the duration between Start and End. |
End
Gets the point of time where this time range end.
Declaration
public DateTime End { get; }
Property Value
Type | Description |
---|---|
System.DateTime | A System.DateTime representing the point of time where this time range end. |
Start
Gets the point of time where this time range begin.
Declaration
public DateTime Start { get; }
Property Value
Type | Description |
---|---|
System.DateTime | A System.DateTime representing the point of time where this time range begin. |
Methods
| Improve this DocEquals(TimeRange)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(TimeRange other)
Parameters
Type | Name | Description |
---|---|---|
TimeRange | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
Overrides
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A composite format string for the System.DateTime properties. |
System.IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
Operators
| Improve this DocEquality(TimeRange, TimeRange)
Indicates whether two TimeRange instances are equal.
Declaration
public static bool operator ==(TimeRange range1, TimeRange range2)
Parameters
Type | Name | Description |
---|---|---|
TimeRange | range1 | The first time period to compare. |
TimeRange | range2 | The second time period to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Inequality(TimeRange, TimeRange)
Indicates whether two TimeRange instances are not equal.
Declaration
public static bool operator !=(TimeRange range1, TimeRange range2)
Parameters
Type | Name | Description |
---|---|---|
TimeRange | range1 | The first time period to compare. |
TimeRange | range2 | The second time period to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|