public virtual bool Overlaps(SyntaxHighlightSegment segment)
 {
     return((this.OrderedStart <= segment.OrderedStart &&
             this.OrderedEnd >= segment.OrderedStart) ||
            (this.OrderedStart <= segment.OrderedEnd &&
             this.OrderedEnd >= segment.OrderedEnd));
 }
 /// <summary>
 /// A Segment is SuperiorTo another segment when it completely contains another segment
 /// or overlaps it and starts earlier.
 /// </summary>
 /// <param name="segment"></param>
 /// <returns></returns>
 public virtual bool SuperiorTo(SyntaxHighlightSegment segment)
 {
     return(this.Contains(segment) || (this.Overlaps(segment) && this.OrderedStart < segment.OrderedStart));
 }
 public virtual bool Contains(SyntaxHighlightSegment segment)
 {
     return(this.OrderedStart <= segment.OrderedStart &&
            this.OrderedEnd >= segment.OrderedEnd);
 }