/// <summary> /// Determines if range contains another range /// </summary> public static bool Contains(ITextRange range, ITextRange other, bool inclusiveEnd) { if (inclusiveEnd) { return(ContainsInclusiveEnd(range, other)); } return(range.Contains(other.Start) && range.Contains(other.End)); }
public override IReadOnlyList <T> ItemsInRange(ITextRange range) { IReadOnlyList <T> list = base.ItemsInRange(range); if (Count > 0) { IHtmlToken lastItem = this[Count - 1] as IHtmlToken; if (lastItem != null && !lastItem.IsWellFormed) { if (range.Contains(lastItem.End)) { // Underlying method returs static readonly collection if nothing was found // in the range so we need to create a new collection here. List <T> modifiedList = new List <T>(list.Count + 1); modifiedList.AddRange(list); modifiedList.Add(this[Count - 1]); list = modifiedList; } } } return(list); }
/// <summary> /// Determines if range contains another range or it contains start point /// of the other range and their end points are the same. /// </summary> public static bool ContainsInclusiveEnd(ITextRange range, ITextRange other) { return(range.Contains(other.Start) && (range.Contains(other.End) || range.End == other.End)); }
/// <summary> /// Determines if range contains another range /// </summary> public static bool Contains(ITextRange range, ITextRange other) { return(range.Contains(other.Start) && range.Contains(other.End)); }
public bool Contains(int position) { return(_range.Contains(position)); }
/// <summary> /// Determines if range contains another range /// </summary> public static bool Contains(ITextRange range, ITextRange other) => range.Contains(other.Start) && range.Contains(other.End);
/// <summary> /// Determines if range contains another range or it contains start point /// of the other range and their end points are the same. /// </summary> public static bool ContainsInclusiveEnd(ITextRange range, ITextRange other) { return range.Contains(other.Start) && (range.Contains(other.End) || range.End == other.End); }
/// <summary> /// Determines if range contains another range /// </summary> public static bool Contains(ITextRange range, ITextRange other, bool inclusiveEnd) { if (inclusiveEnd) return ContainsInclusiveEnd(range, other); else return range.Contains(other.Start) && range.Contains(other.End); }
/// <summary> /// Determines if range contains another range /// </summary> public static bool Contains(ITextRange range, ITextRange other) { return range.Contains(other.Start) && range.Contains(other.End); }