예제 #1
0
        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;
        }
예제 #2
0
        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;
        }