/// <summary> /// Determines whether the specified range overlaps with any of the comparison ranges. /// </summary> /// <param name="range"></param> /// <param name="compareToRanges"></param> private bool AnyRangeOverlap(IndexRange range, List <IndexRange> compareToRanges) { foreach (IndexRange ignoreRange in compareToRanges) { if (range.Overlaps(ignoreRange)) { return(true); } } return(false); }