This is preliminary documentation and is subject to change.

TimeOnlyRange Class

Implements the IRange interface and provides a time range through its Start and End members

Definition

Namespace: MoreDateTime
Assembly: MoreDateTime (in MoreDateTime.dll) Version: 1.3.0
C#
public class TimeOnlyRange
Inheritance
Object    TimeOnlyRange

Constructors

TimeOnlyRange Initializes a new instance of the TimeOnlyRange class.
TimeOnlyRange(TimeOnlyRange) Initializes a copied new instance of the TimeOnlyRange class.
TimeOnlyRange(TimeOnly, TimeOnly) Initializes a new instance of the TimeOnlyRange class.

Properties

End  
IsEmpty Verifies if the range is empty, Start == End == default(T)
Start  

Methods

Contains Verifies if the given value is contained in this range, including start and end
Distance Gets the distance between the Start and the End
Empty Get an empty range
Extend Extends the Start and/or End by the specified timeSpan
IsOrdered Verifies if start is less or equal end
IsWithin Verifies if the this range is contained entirely in the given range, including start and end
Offset Offsets the Start and End by the specified timeSpan
Order Orders the range, so that Start is guaranteed to be less or equal End.

  Note

Does not make much sense for TimeOnlyRange since the time can be spanning 00:00, as in 22:00 - 04:00
Reduce Reduces the Start and/or End by the specified timeSpan

Extension Methods

Difference Calculates the difference of two TimeOnlyRanges. If the two ranges do not overlap, the result is the first TimeOnlyRange. Otherwise, the result is the first TimeOnlyRange without where both ranges overlap.
(Defined by TimeOnlyExtensions)
DoesOverlap Verifies if TimeOnlyRange a overlapps with TimeOnlyRange b.
(Defined by TimeOnlyExtensions)
Intersection Calculates the intersection of two TimeOnlyRanges. If the two ranges do not overlap, the result is an empty TimeOnlyRange. Otherwise, the result is the TimeOnlyRange that where both ranges overlap.
(Defined by TimeOnlyExtensions)
Split Splits the given range of TimeOnly into the given number of parts.
(Defined by TimeOnlyExtensions)
Union Calculates the union of two TimeOnlyRanges. If the two ranges do not overlap, the result is an empty TimeOnlyRange. Otherwise, the result is the TimeOnlyRange that contains both ranges.
(Defined by TimeOnlyExtensions)

See Also