/// <summary> /// Initializes a new instance of the <see cref="InstantRange" /> class using the specified start instant and duration. /// </summary> /// <param name="start">The start instant.</param> /// <param name="duration">The duration.</param> /// <exception cref="System.ArgumentOutOfRangeException">The <paramref name="duration" /> was negative.</exception> /// <remarks> /// The step size is 00:00:01. /// </remarks> public InstantRange(Instant start, Duration duration) : base(start, start + duration, DurationRange.AutoStep(duration)) { if (duration < Duration.Zero) { throw new ArgumentOutOfRangeException(nameof(duration)); } }
/// <summary> /// Initializes a new instance of the <see cref="InstantRange"/> class using the specified start and end instants. /// </summary> /// <param name="start">The start instant.</param> /// <param name="end">The end instant.</param> /// <exception cref="System.ArgumentOutOfRangeException"> /// The <paramref name="start"/> instant was greater than the <paramref name="end"/> instant. /// </exception> /// <remarks>The step size is 00:00:01.</remarks> public InstantRange(Instant start, Instant end) : base(start, end, DurationRange.AutoStep(end - start)) { }
/// <summary> /// Initializes a new instance of the <see cref="ZonedDateTimeRange" /> class. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> public ZonedDateTimeRange(ZonedDateTime start, ZonedDateTime end) : base(start, end, DurationRange.AutoStep(end.ToInstant() - start.ToInstant())) { }