src\Framework\MS\Internal\Annotations\TextAnchor.cs (46)
59_segments.Add(new TextSegment(segment.Start, segment.End));
131for (int i = 0; i < _segments.Count; i++)
133if (_segments[i].Contains(textPointer))
179if (other._segments.Count != this._segments.Count)
182for (int i = 0; i < _segments.Count; i++)
184if ((_segments[i].Start.CompareTo(other._segments[i].Start) != 0) ||
185(_segments[i].End.CompareTo(other._segments[i].End) != 0))
205IEnumerator<TextSegment> ourEnumerator = _segments.GetEnumerator();
300while (currentIndex < anchor._segments.Count && hasMore)
304current = anchor._segments[currentIndex];
321anchor._segments.RemoveAt(currentIndex);
328anchor._segments[currentIndex] = CreateNormalizedSegment(otherSegment.End, current.End);
341anchor._segments[currentIndex] = CreateNormalizedSegment(current.Start, otherSegment.Start);
347anchor._segments.Insert(currentIndex + 1, CreateNormalizedSegment(otherSegment.End, current.End));
358if (anchor._segments.Count > 0)
402while (current < anchor._segments.Count && hasMore)
406currentSegment = anchor._segments[current];
419anchor._segments.RemoveAt(current);
430anchor._segments[current] = CreateNormalizedSegment(otherSegment.Start, currentSegment.End);
439anchor._segments[current] = CreateNormalizedSegment(currentSegment.Start, otherSegment.End);
441anchor._segments.Insert(current + 1, CreateNormalizedSegment(otherSegment.End, currentSegment.End));
457if (!hasMore && current < anchor._segments.Count)
459anchor._segments.RemoveRange(current, anchor._segments.Count - current);
462if (anchor._segments.Count == 0)
518return _segments.Count > 0 ? _segments[0].Start : null;
529return _segments.Count > 0 ? _segments[_segments.Count - 1].End : null;
541return (_segments.Count == 1 && (object)_segments[0].Start == (object)_segments[0].End);
556for (int i = 0; i < _segments.Count; i++)
558textBuffer.Append(TextRangeBase.GetTextInternal(_segments[i].Start, _segments[i].End));
572return _segments.AsReadOnly();
638for (; i < _segments.Count; i++)
640if (newSegment.Start.CompareTo(_segments[i].Start) < 0)
645if (i > 0 && newSegment.Start.CompareTo(_segments[i - 1].End) < 0)
649if (i < _segments.Count && newSegment.End.CompareTo(_segments[i].Start) > 0)
652_segments.Insert(i, newSegment);