Exemplo n.º 1
0
 /// <summary>
 /// Intersects the specified time interval with the current time interval.
 /// </summary>
 /// <param name="interval">The time interval to intersect the current interval with.</param>
 /// <returns>Time interval repsesenting the result of intersection.</returns>
 public TimeInterval Intersect(IInterval <DateTime> interval)
 {
     switch ((Calculus <DateTime> .MaxLower(this, interval), Calculus <DateTime> .MinUpper(this, interval)))
     {
Exemplo n.º 2
0
 /// <summary>
 /// Checks if the current time interval overlaps with specified time interval.
 /// </summary>
 /// <param name="interval">The time interval to check overlapping with.</param>
 /// <returns>True if two intervals are overlapping; otherwise, false.</returns>
 public bool Overlaps(IInterval <DateTime> interval)
 {
     return(Calculus <DateTime> .CompareLowerUpper(Calculus <DateTime> .MaxLower(this, interval), Calculus <DateTime> .MinUpper(this, interval)) <= 0);
 }