public Interval(T Start, T End, IntervalBoundaryType StartType = IntervalBoundaryType.Open, IntervalBoundaryType EndType = IntervalBoundaryType.Open) { if (Start.CompareTo(End) > 0) { throw new ArgumentException("start greater than end"); } this.Start = Start; this.End = End; this.StartType = StartType; this.EndType = EndType; }
public ValueRange( TValue from, TValue to, IntervalBoundaryType leftBoundaryType = DefaultBoundaryType, IntervalBoundaryType rightBoundaryType = DefaultBoundaryType) { if (from.CompareTo(to) > 0) { throw new ArgumentException("From value cannot be greater than to value.", nameof(from)); } From = from; To = to; _leftBoundaryType = leftBoundaryType; _rightBoundaryType = rightBoundaryType; }