Esempio n. 1
0
 /// <summary>
 ///     Returns whether or not the two ranges intersect.
 /// </summary>
 /// <param name="first">The first range.</param>
 /// <param name="second">The second range.</param>
 /// <returns>True if the ranges intersect; otherwise, false.</returns>
 public static bool Intersects(Range<T> first, Range<T> second)
 {
     return !(second.Maximum.CompareTo(first.Minimum) <= 0 || first.Maximum.CompareTo(second.Minimum) <= 0);
 }
Esempio n. 2
0
 /// <summary>
 ///     Returns whether or not <paramref name="other" /> intersects the current range.
 /// </summary>
 /// <param name="other">The other range.</param>
 /// <returns>True if the ranges intersect; otherwise, false.</returns>
 public virtual bool Intersects(Range<T> other)
 {
     return Intersects(this, other);
 }