25 public class RangeT<T> where T : struct, IComparable<T>
38 public RangeT(T minimum, T maximum, T increment)
40 if (minimum.CompareTo(maximum) > 0)
43 "Maximum value has to be bigger than or equal to the minimum value");
46 if (Convert.ToDecimal(increment).CompareTo(Convert.ToDecimal(maximum) - Convert.ToDecimal(minimum)) > 0)
49 "The given increment is larger than the total range!");
79 public override bool Equals(
object? obj)
86 if (ReferenceEquals(
this, obj))
125 return Formatting.Invariant(
126 $
"{GetType().Name}{{ Minimum = {Minimum}, Maximum = {Maximum}, Increment = {Increment} }}");
147 public Range(
int minimum,
int maximum,
int increment)
148 : base(minimum, maximum, increment)
169 public RangeU(uint minimum, uint maximum, uint increment)
170 : base(minimum, maximum, increment)
191 public RangeU8(
byte minimum,
byte maximum,
byte increment)
192 : base(minimum, maximum, increment)
213 public RangeF(
float minimum,
float maximum,
float increment)
214 : base(minimum, maximum, increment)
235 public RangeD(
double minimum,
double maximum,
double increment)
236 : base(minimum, maximum, increment)
Exception thrown when an invalid parameter is detected.
Represents a numeric range with defined boundaries and a fixed increment. A Range models a continuous...
T Increment
Gets the increment value associated with this range.
override int GetHashCode()
Returns a hash code for the current range.
RangeT(T minimum, T maximum, T increment)
Initializes a new instance of the RangeT<T> class with specified minimum, maximum,...
override bool Equals(object? obj)
Determines whether the specified object is equal to the current range.
override string ToString()
Returns a string representation of the range.
T Maximum
Gets the upper boundary of the range.
T Minimum
Gets the lower boundary of the range.
Represents a range with double-precision floating-point boundaries.
RangeD(double minimum, double maximum, double increment)
Initializes a new instance of the RangeD class with specified minimum, maximum, and increment values.
Represents a range with floating-point boundaries.
RangeF(float minimum, float maximum, float increment)
Initializes a new instance of the RangeF class with specified minimum, maximum, and increment values.
Represents a range with signed integer boundaries.
Range(int minimum, int maximum, int increment)
Initializes a new instance of the Range class with specified minimum, maximum, and increment values.
Represents a range with unsigned 8-bit integer boundaries.
RangeU8(byte minimum, byte maximum, byte increment)
Initializes a new instance of the RangeU8 class with specified minimum, maximum, and increment values...
Represents a range with unsigned integer boundaries.
RangeU(uint minimum, uint maximum, uint increment)
Initializes a new instance of the RangeU class with specified minimum, maximum, and increment values.