src\Framework\MS\Internal\Annotations\TextAnchor.cs (34)
57foreach (TextSegment segment in anchor.TextSegments)
152TextSegment newSegment = CreateNormalizedSegment(start, end);
197internal bool IsOverlapping(ICollection<TextSegment> textSegments)
203TextSegment ourSegment, theirSegment;
205IEnumerator<TextSegment> ourEnumerator = _segments.GetEnumerator();
206IEnumerator<TextSegment> theirEnumerator = textSegments.GetEnumerator();
269foreach (TextSegment segment in otherAnchor.TextSegments)
288internal static TextAnchor TrimToRelativeComplement(TextAnchor anchor, ICollection<TextSegment> textSegments)
295IEnumerator<TextSegment> enumerator = textSegments.GetEnumerator();
298TextSegment current;
299TextSegment otherSegment = TextSegment.Null;
302Invariant.Assert(otherSegment.Equals(TextSegment.Null) || otherSegment.Equals(enumerator.Current) || otherSegment.End.CompareTo(enumerator.Current.Start) <= 0, "TextSegments are overlapping or not ordered.");
390internal static TextAnchor TrimToIntersectionWith(TextAnchor anchor, ICollection<TextSegment> textSegments)
396TextSegment currentSegment, otherSegment = TextSegment.Null;
399IEnumerator<TextSegment> enumerator = textSegments.GetEnumerator();
404Invariant.Assert(otherSegment.Equals(TextSegment.Null) || otherSegment.Equals(enumerator.Current) || otherSegment.End.CompareTo(enumerator.Current.Start) <= 0, "TextSegments are overlapping or not ordered.");
568internal ReadOnlyCollection<TextSegment> TextSegments
600private static ICollection<TextSegment> SortTextSegments(ICollection<TextSegment> textSegments, bool excludeZeroLength)
604List<TextSegment> orderedList = new List<TextSegment>(textSegments.Count);
612TextSegment segment = orderedList[i];
635private void InsertSegment(TextSegment newSegment)
661private static TextSegment CreateNormalizedSegment(ITextPointer start, ITextPointer end)
757private List<TextSegment> _segments = new List<TextSegment>(1);
774private class TextSegmentComparer : IComparer<TextSegment>
782public int Compare(TextSegment x, TextSegment y)
784if (x.Equals(TextSegment.Null))
787if (y.Equals(TextSegment.Null))
796if (y.Equals(TextSegment.Null))