/// <summary> /// Gets the maximum time in the <see cref="TimeRange"/>. /// </summary> /// <param name="timeRange"> /// The time range. /// </param> /// <returns> /// The maximum value. /// </returns> public static Timestamp MaxTime(this TimeRange timeRange) { return(Timestamp.Max(timeRange.StartTime, timeRange.EndTime)); }
/// <summary> /// Initializes a new instance of the <see cref="TimeRange"/> /// struct. /// </summary> /// <param name="startTime"> /// The start time of the range. /// </param> /// <param name="duration"> /// The duration of the range. /// </param> public TimeRange(Timestamp startTime, TimestampDelta duration) { this.startTime = startTime; this.endTime = startTime + duration; }
/// <summary> /// Determines whether this instance contains the given <see cref="Timestamp"/>. /// </summary> /// <param name="time"> /// The time to check. /// </param> /// <returns> /// <c>true</c> if <paramref name="time"/> is contained within this range; /// <c>false</c> otherwise. /// </returns> public bool Contains(Timestamp time) { return((this.StartTime <= time) && (time <= this.EndTime)); }
/// <summary> /// Initializes a new instance of the <see cref="TimeRange"/> /// struct. /// </summary> /// <param name="startTime"> /// The start time of the range. /// </param> /// <param name="endTime"> /// The end time for the range. /// </param> public TimeRange(Timestamp startTime, Timestamp endTime) { this.startTime = startTime; this.endTime = endTime; }