/// <summary> /// Gets whether the specified offset is included in the selection. /// </summary> /// <returns>True, if the selection contains the offset (selection borders inclusive); /// otherwise, false.</returns> public virtual bool Contains(int offset) { if (IsEmpty) { return(false); } return(SurroundingSegment.Contains(offset, 0) && Segments.Any(s => s.Contains(offset, 0))); }
/// <summary> /// Gets whether the specified offset is included in the selection. /// </summary> /// <returns>True, if the selection contains the offset (selection borders inclusive); /// otherwise, false.</returns> public virtual bool Contains(int offset) { if (IsEmpty) { return(false); } if (SurroundingSegment.Contains(offset)) { foreach (ISegment s in Segments) { if (s.Contains(offset)) { return(true); } } } return(false); }