RangeExtensions

public static class RangeExtensions
Extensions for the Range<T> structure

Methods

Interval

#Example
public static TimeSpan Interval(this Range<DateTime> range)
Gets the interval for the specified range between the start and end dates.
range (Range<DateTime>)Range to get the interval for.
A new TimeSpan that is the difference between the start and end dates of the specified range.

Length

#Example
public static int Length(this Range<int> range)
Gets the length of the specified range between the start and end values.
range (Range<int>)Range to get the length for.
The length between the start and end values of the specified range.

WithLength

#Example
public static Range<int> WithLength(this Range<int> range, int length)
Creates a new range starting at the same position as the specified range and a new length.
range (Range<int>)Range with the same start but different length of the specified range.
length (int)Length of the new range.
The length for the new range.