src\Framework\MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (35)
135ITextPointer invalidateEnd = _segments[endSeg].Segment.End;
186ITextPointer invalidateEnd = _segments[endSeg].Segment.End;
215ITextPointer invalidateEnd = _segments[endSeg].Segment.End;
266if ((highlightSegment.Segment.End.CompareTo(textPosition) > 0) ||
267((highlightSegment.Segment.End.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward)))
373if (highlightSegment.Segment.End.CompareTo(rangeSegment.Start) > 0)
378IList<HighlightSegment> res = highlightSegment.Split(rangeSegment.Start, rangeSegment.End, highlightRange);
389if (rangeSegment.End.CompareTo(highlightSegment.Segment.End) <= 0)
394(rangeSegment.End.CompareTo(rangeEnumerator.Current.Start) <= 0),
401rangeSegment = new TextSegment(highlightSegment.Segment.End, rangeSegment.End);
421if (rangeSegment.End.CompareTo(highlightSegment.Segment.Start) > 0)
428rangeSegment = new TextSegment(highlightSegment.Segment.Start, rangeSegment.End);
435_segments.Insert(ind++, new HighlightSegment(rangeSegment.Start, rangeSegment.End, highlightRange));
448_segments.Insert(ind++, new HighlightSegment(rangeSegment.Start, rangeSegment.End, highlightRange));
454_segments.Insert(ind++, new HighlightSegment(rangeEnumerator.Current.Start, rangeEnumerator.Current.End, highlightRange));
461invalidateEnd = _segments[ind].Segment.End;
477if (pos.CompareTo(highlightSegment.Segment.End) < 0)
478return highlightSegment.Segment.End;
500if (pos.CompareTo(highlightSegment.Segment.End) <= 0)
507return highlightSegment.Segment.End;
525if (highlightSegment.Segment.End.CompareTo(end) == 0)
785if ((ps.CompareTo(_segment.Start) == 0) || (ps.CompareTo(_segment.End) == 0))
788((ps.CompareTo(_segment.End) == 0) && (side == LogicalDirection.Backward)) )
798res.Add(new HighlightSegment(ps, _segment.End, _owners));
821if ((_segment.Start.CompareTo(ps1) > 0) || (_segment.End.CompareTo(ps1) < 0))
832if (_segment.End.CompareTo(ps1) > 0)
834res.Add(new HighlightSegment(ps1, _segment.End, _owners));
880(res[0].Segment.End.CompareTo(ps2) == 0))
976pageGeometry = view.GetTightBoundingGeometryFromTextPositions(segment.Start, segment.End);
1013while (cursor.CompareTo(_segment.End) < 0)
1031CloseSegment(ref segmentStart, cursor, _segment.End);
1050CloseSegment(ref segmentStart, cursor, _segment.End);
1071CloseSegment(ref segmentStart, cursor, _segment.End);
src\Framework\MS\Internal\Annotations\TextAnchor.cs (39)
59_segments.Add(new TextSegment(segment.Start, segment.End));
185(_segments[i].End.CompareTo(other._segments[i].End) != 0))
216if (theirSegment.Start.CompareTo(theirSegment.End) == 0)
230if ((ourSegment.End.CompareTo(theirSegment.End) == 0) &&
231(theirSegment.End.LogicalDirection == LogicalDirection.Backward))
236if (ourSegment.Start.CompareTo(theirSegment.End) >= 0)
243if (ourSegment.End.CompareTo(theirSegment.Start) <= 0)
302Invariant.Assert(otherSegment.Equals(TextSegment.Null) || otherSegment.Equals(enumerator.Current) || otherSegment.End.CompareTo(enumerator.Current.Start) <= 0, "TextSegments are overlapping or not ordered.");
309if (current.Start.CompareTo(otherSegment.End) >= 0)
319if (current.End.CompareTo(otherSegment.End) <= 0)
328anchor._segments[currentIndex] = CreateNormalizedSegment(otherSegment.End, current.End);
339if (current.End.CompareTo(otherSegment.Start) > 0)
344if (current.End.CompareTo(otherSegment.End) > 0)
347anchor._segments.Insert(currentIndex + 1, CreateNormalizedSegment(otherSegment.End, current.End));
404Invariant.Assert(otherSegment.Equals(TextSegment.Null) || otherSegment.Equals(enumerator.Current) || otherSegment.End.CompareTo(enumerator.Current.Start) <= 0, "TextSegments are overlapping or not ordered.");
410if (currentSegment.Start.CompareTo(otherSegment.End) >= 0)
417if (currentSegment.End.CompareTo(otherSegment.Start) <= 0)
430anchor._segments[current] = CreateNormalizedSegment(otherSegment.Start, currentSegment.End);
437if (currentSegment.End.CompareTo(otherSegment.End) > 0)
439anchor._segments[current] = CreateNormalizedSegment(currentSegment.Start, otherSegment.End);
441anchor._segments.Insert(current + 1, CreateNormalizedSegment(otherSegment.End, currentSegment.End));
445else if (currentSegment.End.CompareTo(otherSegment.End) == 0)
529return _segments.Count > 0 ? _segments[_segments.Count - 1].End : null;
541return (_segments.Count == 1 && (object)_segments[0].Start == (object)_segments[0].End);
558textBuffer.Append(TextRangeBase.GetTextInternal(_segments[i].Start, _segments[i].End));
613if (segment.Start.CompareTo(segment.End) >= 0)
645if (i > 0 && newSegment.Start.CompareTo(_segments[i - 1].End) < 0)
649if (i < _segments.Count && newSegment.End.CompareTo(_segments[i].Start) > 0)
806return x.End.CompareTo(y.End);
src\Framework\System\Windows\Documents\TextRange.cs (4)
1641TextRangeEdit.SetParagraphProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction);
1645TextRangeEdit.SetInlineProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction);
1650TextRangeEdit.SetInlineProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction);
1667TextRangeEdit.SetParagraphProperty((TextPointer)textSegment.Start, (TextPointer)textSegment.End, formattingProperty, value, propertyValueAction);