Ejemplo n.º 1
0
 /// <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));
     }
 }
Ejemplo n.º 2
0
 /// <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))
 {
 }
Ejemplo n.º 3
0
 /// <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()))
 {
 }