/// <summary> /// Initializes new instance of a time interval from the interfaces an upper and a lower interval reference values. /// </summary> /// <param name="upper">The interface to the upper interval boundary to set the interval with.</param> /// <param name="lower">The interface to the lower interval boundary to set the interval with.</param> /// <param name="type">The time interval flexibility mode to set to the time interval.</param> public TimeInterval(IIntervalUpper <DateTime> upper, IIntervalLower <DateTime> lower, IntervalType type = IntervalType.Flex) { _limits = IntervalLimits.Lower | IntervalLimits.Upper; if (upper != null) { if (upper.UpperInclude) { _limits &= ~IntervalLimits.Lower; } _lower = upper.Upper; } if (lower != null) { if (upper == null) { _lower = lower.Lower; } if (lower.LowerInclude) { _limits &= ~IntervalLimits.Upper; } _upper = lower.Lower; } _span = _upper - _lower; Type = type; }
/// <summary> /// Initializes the new instance of the stream block fragment based on upper and lower range/span limit values. /// </summary> /// <param name="upper">The interface to the upper interval boundary to set the interval with.</param> /// <param name="lower">The interface to the lower interval boundary to set the interval with.</param> public Fragment(IIntervalUpper <DateTime> upper, IIntervalLower <DateTime> lower) { _interval = new TimeInterval(upper, lower); }