1898 references to LogicalDirection
PresentationFramework (1891)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (6)
96ITextPointer startPointer = segment.Start.CreatePointer(LogicalDirection.Forward); 103ITextPointer endPointer = segment.End.CreatePointer(LogicalDirection.Backward); 544if (!start.IsAtInsertionPosition && !start.MoveToNextInsertionPosition(LogicalDirection.Forward)) 568if (!end.IsAtInsertionPosition && !end.MoveToNextInsertionPosition(LogicalDirection.Backward)) 602start = textView.TextSegments[0].Start.CreatePointer(LogicalDirection.Forward); 603end = textView.TextSegments[textView.TextSegments.Count - 1].End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Anchoring\TextSelectionHelper.cs (5)
135current.MoveToNextContextPosition(LogicalDirection.Forward); 190IDocumentPaginatorSource content = GetPointerPage(pointer.CreatePointer(LogicalDirection.Forward), out pageNumber); 231return GetAnchorPointForPointer(anchor.Start.CreatePointer(LogicalDirection.Forward)); 423ITextPointer start = segment.Start.CreatePointer(LogicalDirection.Forward); 424ITextPointer end = segment.End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (20)
237internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 246((highlightSegment.Segment.Start.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward))) 253((highlightSegment.Segment.End.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward))) 264internal override bool IsContentHighlighted(StaticTextPointer staticTextPosition, LogicalDirection direction) 271internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 275if (direction == LogicalDirection.Forward) 760internal IList<HighlightSegment> Split(ITextPointer ps, LogicalDirection side) 765if (((ps.CompareTo(_segment.Start) == 0) && (side == LogicalDirection.Forward)) || 766((ps.CompareTo(_segment.End) == 0) && (side == LogicalDirection.Backward))) 823IList<HighlightSegment> r1 = Split(ps1, LogicalDirection.Forward); 828IList<HighlightSegment> r2 = r1[i].Split(ps2, LogicalDirection.Backward); 845res = Split(ps2, LogicalDirection.Backward); 991TextPointerContext nextContext = cursor.GetPointerContext(LogicalDirection.Forward); 994Type elementType = cursor.GetElementType(LogicalDirection.Forward); 1008cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1028cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1036cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1056segmentStart = cursor.GetInsertionPosition(LogicalDirection.Forward); 1073ITextPointer segmentEnd = cursor.GetInsertionPosition(LogicalDirection.Backward); 1103ITextView parentView = TextSelectionHelper.GetDocumentPageTextView(TopOwner.Range.Start.CreatePointer(LogicalDirection.Forward));
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (8)
661ITextPointer start = anchor.Start.CreatePointer(LogicalDirection.Forward); 662ITextPointer end = anchor.End.CreatePointer(LogicalDirection.Backward); 799LogicalDirection direction = pointer.LogicalDirection; 827nextPointer = nextPointer.CreatePointer(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 833if (direction == LogicalDirection.Forward) 858if (direction == LogicalDirection.Backward)
MS\Internal\Annotations\TextAnchor.cs (8)
114textPointer = textPointer.GetInsertionPosition(LogicalDirection.Forward); 118textPointer = textPointer.GetInsertionPosition(LogicalDirection.Backward); 216(theirSegment.Start.LogicalDirection == LogicalDirection.Forward)) 222(theirSegment.End.LogicalDirection == LogicalDirection.Backward)) 667start = start.GetInsertionPosition(LogicalDirection.Forward); 671end = end.GetInsertionPosition(LogicalDirection.Backward); 678if (start.LogicalDirection == LogicalDirection.Backward) 681start = end.GetFrozenPointer(LogicalDirection.Backward);
MS\Internal\Documents\DocumentGrid.cs (1)
299tp = tp.CreatePointer(LogicalDirection.Forward);
MS\Internal\Documents\DocumentPageTextView.cs (1)
256internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\DocumentViewerHelper.cs (1)
402contextMenuPosition = textContainer.TextSelection.Start.CreatePointer(LogicalDirection.Forward);
MS\Internal\Documents\HostedElements.cs (9)
92_currentPosition.MoveToNextContextPosition(LogicalDirection.Forward); 101if (_currentPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart || 102_currentPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement) 108_currentPosition.MoveToNextContextPosition(LogicalDirection.Forward); 173switch (_currentPosition.GetPointerContext(LogicalDirection.Forward)) 176Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 177currentElement = _currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 180Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement); 181currentElement = (IInputElement)_currentPosition.GetAdjacentElement(LogicalDirection.Forward);
MS\Internal\Documents\LineResult.cs (1)
42internal abstract ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction);
MS\Internal\Documents\MultiPageTextView.cs (1)
236internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\ParagraphResult.cs (1)
382internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\TableTextElementCollectionInternal.cs (2)
153TextPointer startPosition = new TextPointer(item.TextContainer, item.TextElementNode, ElementEdge.BeforeStart, LogicalDirection.Backward); 154TextPointer endPosition = new TextPointer(item.TextContainer, item.TextElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
MS\Internal\Documents\TextBoxLine.cs (8)
74switch (position.GetPointerContext(LogicalDirection.Forward)) 112ITextPointer position = _owner.Host.TextContainer.CreatePointerAtOffset(dcp, LogicalDirection.Backward); 117int runLength = Math.Min(128, position.GetTextRunLength(LogicalDirection.Backward)); 119position.GetTextInRun(LogicalDirection.Backward, text, 0, runLength); 424StaticTextPointer endOfRunPosition = _owner.Host.TextContainer.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 436TextDecorationCollection highlightDecorations = highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection; 454&& highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(TextSelection)) != DependencyProperty.UnsetValue) 483int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length);
MS\Internal\Documents\TextBoxView.cs (53)
631if (offset > 0 && position.LogicalDirection == LogicalDirection.Backward) 655if (position.LogicalDirection == LogicalDirection.Forward || position.Offset == 0) 662if (position.LogicalDirection == LogicalDirection.Backward && position.Offset > 0) 703firstLineIndex = Math.Max(firstLineIndex, GetLineIndexFromOffset(startOffset, LogicalDirection.Forward)); 704lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward)); 743ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].EndOffset, LogicalDirection.Backward); 744if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 783nextLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex + linesMoved].Offset, LogicalDirection.Forward); 822if (position.LogicalDirection == LogicalDirection.Forward) 827else if (position.LogicalDirection == LogicalDirection.Backward) 852ITextPointer ITextView.GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 858if (position.Offset == 0 && direction == LogicalDirection.Backward) 860return position.GetFrozenPointer(LogicalDirection.Forward); 862else if (position.Offset == _host.TextContainer.SymbolCount && direction == LogicalDirection.Forward) 864return position.GetFrozenPointer(LogicalDirection.Backward); 874if (direction == LogicalDirection.Forward) 887LogicalDirection logicalDirection; 889direction == LogicalDirection.Forward) 895logicalDirection = LogicalDirection.Backward; 899logicalDirection = LogicalDirection.Forward; 903direction == LogicalDirection.Backward) 909logicalDirection = LogicalDirection.Forward; 913logicalDirection = LogicalDirection.Backward; 918logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 937return position.GetFrozenPointer(LogicalDirection.Forward); 940int lineIndex = GetLineIndexFromPosition(position, LogicalDirection.Backward); 950LogicalDirection logicalDirection; 957logicalDirection = LogicalDirection.Forward; 961logicalDirection = LogicalDirection.Backward; 966logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 984ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].Offset, LogicalDirection.Forward); 985ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].Offset + _lineMetrics[lineIndex].ContentLength, LogicalDirection.Forward); 1307ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[0].Offset, LogicalDirection.Backward); 1308ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[_lineMetrics.Count - 1].EndOffset, LogicalDirection.Forward); 1702private int GetLineIndexFromPosition(ITextPointer position, LogicalDirection direction) 1708private int GetLineIndexFromOffset(int offset, LogicalDirection direction) 1710if (offset > 0 && direction == LogicalDirection.Backward) 1756LogicalDirection logicalDirection; 1762logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 1937int firstLineIndex = GetLineIndexFromOffset(range.StartIndex, LogicalDirection.Forward); 1939int lastLineIndex = GetLineIndexFromOffset(endOffset, LogicalDirection.Backward); 2059ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward); 2060if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward)) 2104ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward); 2106if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 2155ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward); 2156if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward)) 2183ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward); 2185if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 2386int lineIndex = GetLineIndexFromOffset(range.StartIndex, LogicalDirection.Forward);
MS\Internal\Documents\TextContainerHelper.cs (23)
92_textContainer.CreatePointerAtOffset(_cpFirst, LogicalDirection.Forward), 93_textContainer.CreatePointerAtOffset(_cpLast, LogicalDirection.Backward), 102_textContainer.CreatePointerAtOffset(_ranges[i * 2], LogicalDirection.Forward), 103_textContainer.CreatePointerAtOffset(_ranges[i * 2 + 1], LogicalDirection.Backward), 121if (cpPos == _cpFirst && position.LogicalDirection == LogicalDirection.Backward || 122cpPos == _cpLast && position.LogicalDirection == LogicalDirection.Forward) 138if (cpPos == _ranges[i * 2] && position.LogicalDirection == LogicalDirection.Backward || 139cpPos == _ranges[i * 2 + 1] && position.LogicalDirection == LogicalDirection.Forward) 157startPosition = _textContainer.CreatePointerAtOffset(IsSimple ? _cpFirst : _ranges[0], LogicalDirection.Forward); 169endPosition = _textContainer.CreatePointerAtOffset(IsSimple ? _cpLast : _ranges[(_size - 1) * 2 + 1], LogicalDirection.Backward); 321if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 324element = start.GetAdjacentElement(LogicalDirection.Forward); 336start.MoveToNextContextPosition(LogicalDirection.Forward); 342else if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement) 345element = start.GetAdjacentElement(LogicalDirection.Forward); 378if (!start.MoveToNextContextPosition(LogicalDirection.Forward)) 406object element = position.GetAdjacentElement(LogicalDirection.Forward); 444element = position.GetAdjacentElement(LogicalDirection.Forward); 448positionsStart.Insert(0, position.CreatePointer(LogicalDirection.Forward)); 460element = position.GetAdjacentElement(LogicalDirection.Backward); 464positionsEnd.Insert(0, position.CreatePointer(LogicalDirection.Backward)); 549textPointer = textContainer.CreatePointerAtOffset(0, LogicalDirection.Forward); // Start 584internal static ITextPointer GetTextPointerFromCP(ITextContainer textContainer, int cp, LogicalDirection direction)
MS\Internal\Documents\TextDocumentView.cs (29)
296internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 479if (position.LogicalDirection == LogicalDirection.Forward) 489if (segment.Start.LogicalDirection == LogicalDirection.Backward) 498if (position.LogicalDirection == LogicalDirection.Backward) 508if (segment.End.LogicalDirection == LogicalDirection.Forward) 521if (position.TextContainer.Start.CompareTo(position) == 0 && position.LogicalDirection == LogicalDirection.Backward) 525else if (position.TextContainer.End.CompareTo(position) == 0 && position.LogicalDirection == LogicalDirection.Forward) 764position = paragraph.StartPosition.CreatePointer(LogicalDirection.Forward); 768position = paragraph.EndPosition.CreatePointer(LogicalDirection.Backward); 867position = blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward); 871position = blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward); 881position = paragraph.StartPosition.CreatePointer(LogicalDirection.Forward); 885position = paragraph.EndPosition.CreatePointer(LogicalDirection.Backward); 1554private ITextPointer GetNextCaretUnitPosition(ReadOnlyCollection<ParagraphResult> paragraphs, ReadOnlyCollection<ParagraphResult> floatingElements, ITextPointer position, LogicalDirection direction) 1591private ITextPointer GetNextCaretUnitPosition(ParagraphResult paragraph, ITextPointer position, LogicalDirection direction) 1660private ITextPointer GetNextCaretUnitPosition(ReadOnlyCollection<ColumnResult> columns, ReadOnlyCollection<ParagraphResult> floatingElements, ITextPointer position, LogicalDirection direction) 2371lineRange = new TextSegment(blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward), blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward)); 2499positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 2519positionOut = lines[0].StartPosition.CreatePointer(LogicalDirection.Forward); 2531positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 2871positionOut = blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward); 2875positionOut = blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward); 2978positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 2993positionOut = lines[0].StartPosition.CreatePointer(LogicalDirection.Forward); 3005positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 3253segmentEnd = _textContainer.Start.CreatePointer(backgroundFormatInfo.CPInterrupted, LogicalDirection.Backward); 3446if (textPointer.LogicalDirection == LogicalDirection.Forward && textPointer.CompareTo(textElement.ElementStart) == 0) 3451if (textPointer.LogicalDirection == LogicalDirection.Backward && textPointer.CompareTo(textElement.ElementEnd) == 0)
MS\Internal\Documents\TextParagraphView.cs (6)
178positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 207internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 397if (position.LogicalDirection == LogicalDirection.Forward && (lineIndex != lines.Count - 1)) 404if (position.LogicalDirection == LogicalDirection.Backward && lineIndex != 0) 416( position.LogicalDirection == LogicalDirection.Backward || 417(position.LogicalDirection == LogicalDirection.Forward && (lineIndex == lines.Count - 1)))));
MS\Internal\Documents\TextViewBase.cs (2)
90internal abstract ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction); 521ITextPointer ITextView.GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\PtsHost\ContainerParagraph.cs (3)
231ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, prevParagraph.ParagraphEndCharacterPosition, LogicalDirection.Forward); 1012switch (textPointer.GetPointerContext(LogicalDirection.Forward)) 1045TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\FlowDocumentPage.cs (3)
955switch (searchPosition.GetPointerContext(LogicalDirection.Forward)) 958DependencyObject embeddedObject = searchPosition.GetAdjacentElement(LogicalDirection.Forward); 972searchPosition.MoveToNextContextPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\Line.cs (9)
144switch (position.GetPointerContext(LogicalDirection.Forward)) 190ITextPointer startPosition = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara, LogicalDirection.Forward); 191ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward); 194while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 203string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 593position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, cp, LogicalDirection.Forward) as TextPointer; 598type = position.GetPointerContext((charIndex.TrailingLength == 0) ? LogicalDirection.Forward : LogicalDirection.Backward); 608element = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\LineBase.cs (9)
82Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 102endOfRunPosition = position.TextContainer.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 117int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 131Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 135TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 246Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 257TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 300Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object."); 303DependencyObject embeddedObject = position.GetAdjacentElement(LogicalDirection.Forward) as DependencyObject;
MS\Internal\PtsHost\ListParagraph.cs (4)
68TextPointerContext runType = textPointer.GetPointerContext(LogicalDirection.Forward); 71TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 117textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 127textPointer.MoveToNextContextPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\OptimalTextSource.cs (6)
91switch (position.GetPointerContext(LogicalDirection.Forward)) 138ITextPointer startPosition = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara, LogicalDirection.Forward); 139ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward); 142while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 151string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 177ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward);
MS\Internal\PtsHost\TextParaClient.cs (56)
643RectFromDcpSimpleLines(0, 0, LogicalDirection.Forward, TextPointerContext.Text, ref textDetails.u.full, ref rect, ref vrBaseline); 648RectFromDcpCompositeLines(0, 0, LogicalDirection.Forward, TextPointerContext.Text, ref textDetails.u.full, ref rect, ref vrBaseline); 660internal ITextPointer GetTextPosition(int dcp, LogicalDirection direction) 679if (position.LogicalDirection == LogicalDirection.Backward && dcp > 0) 871internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 1091LogicalDirection logicalDirection = (charHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 1632LogicalDirection orientation, 1684if (orientation == LogicalDirection.Forward) 1697if (orientation == LogicalDirection.Backward && originalDcp > 0 && (context == TextPointerContext.Text || context == TextPointerContext.EmbeddedElement)) 1720LogicalDirection orientation, 1781if (orientation == LogicalDirection.Forward) 1791if (orientation == LogicalDirection.Backward && originalDcp > 0 && (context == TextPointerContext.Text || context == TextPointerContext.EmbeddedElement)) 2034ITextPointer position = Paragraph.StructuralCache.TextContainer.CreatePointerAtOffset(Paragraph.ParagraphStartCharacterPosition + dcp, LogicalDirection.Forward); 2036return (TextPointerBase.IsNextToAnyBreak(position, LogicalDirection.Backward)); 2398if (position.LogicalDirection == LogicalDirection.Backward) 2423else if (position.LogicalDirection == LogicalDirection.Forward) 2501if (position.LogicalDirection == LogicalDirection.Backward) 2547else if (position.LogicalDirection == LogicalDirection.Forward) 2583LogicalDirection direction, 2608if (dcp == lineDesc.dcpFirst && direction == LogicalDirection.Backward) 2623else if (dcp >= lineDesc.dcpLim - 1 && direction == LogicalDirection.Forward) 2652if (direction == LogicalDirection.Forward) 2661LogicalDirection logicalDirection; 2662if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == lineDesc.dcpLim) && direction == LogicalDirection.Forward) 2668logicalDirection = LogicalDirection.Backward; 2672logicalDirection = LogicalDirection.Forward; 2675else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == lineDesc.dcpFirst) && direction == LogicalDirection.Backward) 2681logicalDirection = LogicalDirection.Forward; 2685logicalDirection = LogicalDirection.Backward; 2690logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2708LogicalDirection direction, 2742if (dcp == element.dcpFirst && direction == LogicalDirection.Backward) 2782else if (dcp >= element.dcpLim - 1 && direction == LogicalDirection.Forward) 2815if (direction == LogicalDirection.Forward) 2824LogicalDirection logicalDirection; 2825if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == element.dcpLim) && direction == LogicalDirection.Forward) 2831logicalDirection = LogicalDirection.Backward; 2836logicalDirection = LogicalDirection.Forward; 2839else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == element.dcpFirst) && direction == LogicalDirection.Backward) 2845logicalDirection = LogicalDirection.Forward; 2850logicalDirection = LogicalDirection.Backward; 2855logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2931LogicalDirection logicalDirection; 2938logicalDirection = LogicalDirection.Forward; 2942logicalDirection = LogicalDirection.Backward; 2947logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 3057LogicalDirection logicalDirection; 3064logicalDirection = LogicalDirection.Forward; 3068logicalDirection = LogicalDirection.Backward; 3073logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
MS\Internal\PtsHost\TextParagraph.cs (12)
570StructuralCache.CurrentFormatContext.DependentMax = StructuralCache.TextContainer.CreatePointerAtOffset(dcpDependAbsolute, LogicalDirection.Backward); 751StructuralCache.CurrentFormatContext.DependentMax = StructuralCache.TextContainer.CreatePointerAtOffset(dcpDependAbsolute, LogicalDirection.Backward); 862ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, ParagraphStartCharacterPosition + dcpFirst, LogicalDirection.Forward); 865while(textPointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 867TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 886ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, ParagraphStartCharacterPosition + dcpFirst, LogicalDirection.Forward); 895if(textPointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 897TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 906textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 911textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 1191if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1193invalid = (objectElement != position.GetAdjacentElement(LogicalDirection.Forward));
MS\Internal\PtsHost\TextParaLineResult.cs (5)
67internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 109return _owner.GetTextPosition(_dcp + _cchContent, LogicalDirection.Backward); 121return _owner.GetTextPosition(_dcp + _cch - _cchEllipses, LogicalDirection.Forward); 173_startPosition = _owner.GetTextPosition(_dcp, LogicalDirection.Forward); 188_endPosition = _owner.GetTextPosition(_dcp + _cch, LogicalDirection.Backward);
MS\Internal\Text\ComplexLine.cs (17)
42switch (position.GetPointerContext(LogicalDirection.Forward)) 89ITextPointer position = _owner.TextContainer.CreatePointerAtOffset(dcp, LogicalDirection.Backward); 92while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 100string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 283position = new TextPointer(_owner.ContentStart, CalcPositionOffset(charHit), LogicalDirection.Forward); 290type = position.GetPointerContext(LogicalDirection.Forward); 295type = position.GetPointerContext(LogicalDirection.Backward); 306element = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 334Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 353endOfRunPosition = _owner.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 368int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 381Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 385TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 472Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 476TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 522Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object."); 525DependencyObject element = position.GetAdjacentElement(LogicalDirection.Forward) as DependencyObject;
MS\Internal\Text\DynamicPropertyReader.cs (1)
254selected = position.TextContainer.Highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(TextSelection));
MS\Internal\Text\TextLineResult.cs (5)
62internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 102return _owner.TextContainer.CreatePointerAtOffset(_dcp + _cchContent, LogicalDirection.Backward); 118return _owner.TextContainer.CreatePointerAtOffset(_dcp + _cch - _cchEllipses, LogicalDirection.Forward); 170_startPosition = _owner.TextContainer.CreatePointerAtOffset(_dcp, LogicalDirection.Forward); 185_endPosition = _owner.TextContainer.CreatePointerAtOffset(_dcp + _cch, LogicalDirection.Backward);
MS\Internal\Text\TextProperties.cs (1)
234textDecorations = highlights.GetHighlightValue(highlightPosition, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection;
System\Windows\Annotations\AnnotationHelper.cs (4)
673start.MoveToNextInsertionPosition(LogicalDirection.Backward); 674end.MoveToNextInsertionPosition(LogicalDirection.Forward); 856(selection.Start.LogicalDirection == LogicalDirection.Forward)) || 858(selection.End.LogicalDirection == LogicalDirection.Backward)))
System\Windows\Automation\Peers\TextElementAutomationPeer.cs (1)
117TextPointer endPosition = textElement.ContentStart.GetNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Controls\AccessText.cs (6)
579TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 583string text = navigator.GetTextInRun(LogicalDirection.Forward); 618navigator.MoveToNextContextPosition(LogicalDirection.Forward); 627TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 631string text = navigator.GetTextInRun(LogicalDirection.Forward); 654navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Controls\FlowDocumentReader.cs (4)
1986public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom, FlowDocumentReaderViewingMode viewingMode) 1994public LogicalDirection ContentPositionDirection; 2005LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\FlowDocumentScrollViewer.cs (4)
1926public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom) 1933public LogicalDirection ContentPositionDirection; 1943LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\PasswordBox.cs (2)
1068while (start-- > 0 && selectionStart.MoveToNextInsertionPosition(LogicalDirection.Forward)) 1074while (length-- > 0 && selectionEnd.MoveToNextInsertionPosition(LogicalDirection.Forward))
System\Windows\Controls\PasswordTextContainer.cs (20)
212ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 218ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 223ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 230return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 233TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 243int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 248object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 263StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 514return new PasswordTextPointer(this, LogicalDirection.Backward, 0); 528return new PasswordTextPointer(this, LogicalDirection.Forward, this.SymbolCount); 670textPosition = new PasswordTextPointer(this, LogicalDirection.Forward, offset); 707index = FindIndex(offset, LogicalDirection.Forward); 740if (position.LogicalDirection == LogicalDirection.Backward) 804private int FindIndex(int offset, LogicalDirection gravity) 818(position.LogicalDirection == gravity || gravity == LogicalDirection.Backward)) 839LogicalDirection lastLogicalDirection; 842lastLogicalDirection = LogicalDirection.Backward; 854position.LogicalDirection == LogicalDirection.Backward && 859Invariant.Assert(lastLogicalDirection != LogicalDirection.Forward); 910Debug.Write($"({position.DebugId}) {position.Offset}/{((position.LogicalDirection == LogicalDirection.Forward) ? "f " : "b ")}");
System\Windows\Controls\PasswordTextNavigator.cs (27)
26internal PasswordTextPointer(PasswordTextContainer container, LogicalDirection gravity, int offset) 50void ITextPointer.SetLogicalDirection(LogicalDirection direction) 134TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 138if ((direction == LogicalDirection.Backward && _offset == 0) || 139(direction == LogicalDirection.Forward && _offset == _container.SymbolCount)) 166int ITextPointer.GetTextRunLength(LogicalDirection direction) 170if (direction == LogicalDirection.Forward) 183string ITextPointer.GetTextInRun(LogicalDirection direction) 188int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 194if (direction == LogicalDirection.Forward) 223object ITextPointer.GetAdjacentElement(LogicalDirection direction) 243Type ITextPointer.GetElementType(LogicalDirection direction) 328ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 350ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 364ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 419bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 425if (direction == LogicalDirection.Backward) 519Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 524bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 529bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 536ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 551ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 560ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 577ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 649LogicalDirection ITextPointer.LogicalDirection 700internal LogicalDirection LogicalDirection 752private LogicalDirection _gravity;
System\Windows\Controls\RichTextBox.cs (1)
267public TextPointer GetNextSpellingErrorPosition(TextPointer position, LogicalDirection direction)
System\Windows\Controls\SinglePageViewer.cs (4)
1521public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom) 1528public LogicalDirection ContentPositionDirection; 1538LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\TextAdaptor.cs (12)
115TextRangeAdaptor.MoveToInsertionPosition(start, LogicalDirection.Forward); 116TextRangeAdaptor.MoveToInsertionPosition(end, LogicalDirection.Backward); 276FrameworkContentElement element = pointer.GetAdjacentElement(LogicalDirection.Backward) as FrameworkContentElement; 615TextPointerContext context = position.GetPointerContext(LogicalDirection.Forward); 618if (childElement == position.GetAdjacentElement(LogicalDirection.Forward)) 620rangeStart = position.CreatePointer(LogicalDirection.Forward); 622rangeEnd = position.CreatePointer(LogicalDirection.Backward); 628if (childElement == position.GetAdjacentElement(LogicalDirection.Forward)) 630rangeStart = position.CreatePointer(LogicalDirection.Forward); 631position.MoveToNextContextPosition(LogicalDirection.Forward); 632rangeEnd = position.CreatePointer(LogicalDirection.Backward); 636position.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Controls\TextBlock.cs (29)
2142LogicalDirection logicalDirection; 2144logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2176if (orientedPosition.LogicalDirection == LogicalDirection.Backward && characterIndex > 0) 2234if (orientedPosition.LogicalDirection == LogicalDirection.Forward || originalCharacterIndex == 0) 2244if (orientedPosition.LogicalDirection == LogicalDirection.Backward && originalCharacterIndex > 0) 2337&& TextPointerBase.IsNextToAnyBreak(endOfLineTextPointer, LogicalDirection.Backward)) 2388if (position.LogicalDirection == LogicalDirection.Backward) 2402else if (position.LogicalDirection == LogicalDirection.Forward) 2444internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction, int dcp, int lineIndex) 2455if (characterIndex == dcp && direction == LogicalDirection.Backward) 2472else if (characterIndex == (dcp + GetLine(lineIndex).Length) && direction == LogicalDirection.Forward) 2508if (direction == LogicalDirection.Forward) 2521LogicalDirection logicalDirection; 2522if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == (dcp + GetLine(lineIndex).Length)) && direction == LogicalDirection.Forward) 2528logicalDirection = LogicalDirection.Backward; 2532logicalDirection = LogicalDirection.Forward; 2535else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == dcp) && direction == LogicalDirection.Backward) 2541logicalDirection = LogicalDirection.Forward; 2545logicalDirection = LogicalDirection.Backward; 2550logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2622LogicalDirection logicalDirection; 2629logicalDirection = LogicalDirection.Forward; 2633logicalDirection = LogicalDirection.Backward; 2638logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 3659switch (position.GetPointerContext(LogicalDirection.Forward)) 3662DependencyObject embeddedObject = position.GetAdjacentElement(LogicalDirection.Forward);
System\Windows\Controls\TextBox.cs (24)
161TextPointer newStart = this.TextContainer.CreatePointerAtOffset(start, LogicalDirection.Forward); 165newStart = newStart.GetInsertionPosition(LogicalDirection.Forward); 173TextPointer newEnd = new TextPointer(newStart, length, LogicalDirection.Forward); 176newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 216return (textPointer.LogicalDirection == LogicalDirection.Backward) ? offset - 1 : offset; 264TextPointer position = this.TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Forward); 439TextPointer textPointer = TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Backward); 440textPointer = textPointer.GetInsertionPosition(LogicalDirection.Backward); 445textPointer = textPointer.GetNextInsertionPosition(LogicalDirection.Forward); 449textPointer = textPointer.GetPositionAtOffset(0, LogicalDirection.Backward); 454textPointer = textPointer.GetPositionAtOffset(0, LogicalDirection.Forward); 479TextPointer position = this.TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Forward); 480SpellingError spellingError = this.TextEditor.GetSpellingErrorAtPosition(position, LogicalDirection.Forward); 484position = this.TextContainer.CreatePointerAtOffset(charIndex + 1, LogicalDirection.Forward); 485spellingError = this.TextEditor.GetSpellingErrorAtPosition(position, LogicalDirection.Backward); 545public int GetNextSpellingErrorCharacterIndex(int charIndex, LogicalDirection direction) 811TextPointer newEnd = new TextPointer(TextSelectionInternal.Start, value, LogicalDirection.Forward); 814newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 855TextPointer newStart = TextContainer.CreatePointerAtOffset(value, LogicalDirection.Forward); 859newStart = newStart.GetInsertionPosition(LogicalDirection.Forward); 867TextPointer newEnd = new TextPointer(newStart, selectionLength, LogicalDirection.Forward); 870newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 1477if (TextPointerBase.IsNextToPlainLineBreak(textPointer, LogicalDirection.Forward)) 1479textPointer.MoveToNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Controls\TextRangeAdaptor.cs (77)
480internal static bool MoveToInsertionPosition(ITextPointer position, LogicalDirection direction) 528TextPointerBase.MoveToNextInsertionPosition(_start, LogicalDirection.Backward); 532TextPointerBase.MoveToNextInsertionPosition(_end, LogicalDirection.Forward); 539MoveToNextWordBoundary(_start, LogicalDirection.Backward); 543MoveToNextWordBoundary(_end, LogicalDirection.Forward); 553TextPointerContext forwardContext = _start.GetPointerContext(LogicalDirection.Forward); 556TextPointerContext backwardContext = _start.GetPointerContext(LogicalDirection.Backward); 564_start.MoveToNextContextPosition(LogicalDirection.Backward); 570TextPointerContext backwardContext = _end.GetPointerContext(LogicalDirection.Backward); 573TextPointerContext forwardContext = _end.GetPointerContext(LogicalDirection.Forward); 581_end.MoveToNextContextPosition(LogicalDirection.Forward); 587_start.SetLogicalDirection(LogicalDirection.Forward); 588_end.SetLogicalDirection(LogicalDirection.Forward); 725private bool MoveToUnitBoundary(ITextPointer position, bool isStart, LogicalDirection direction, TextUnit unit) 763if (moved && direction == LogicalDirection.Forward) 767TextPointerContext context = position.GetPointerContext(LogicalDirection.Forward); 772position.MoveToNextContextPosition(LogicalDirection.Forward); 791if (direction == LogicalDirection.Forward) 809nextLineStart = GetInsertionPosition(nextLineStart, LogicalDirection.Forward); 814position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 836previousLineEnd = GetInsertionPosition(previousLineEnd, LogicalDirection.Backward); 841position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 854if (direction == LogicalDirection.Forward) 861if (nextParagraphStart.MoveToNextInsertionPosition(LogicalDirection.Forward)) 871position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 882if (previousParagraphEnd.MoveToNextInsertionPosition(LogicalDirection.Backward)) 892position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 921if (direction == LogicalDirection.Forward) 925if (position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementEnd) 931Invariant.Assert(position.MoveToNextContextPosition(LogicalDirection.Forward)); 933MoveToInsertionPosition(position, LogicalDirection.Forward); 939if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart) 945Invariant.Assert(position.MoveToNextContextPosition(LogicalDirection.Backward)); 947MoveToInsertionPosition(position, LogicalDirection.Backward); 954if (direction == LogicalDirection.Forward) 956if (position.CompareTo(GetInsertionPosition(position.TextContainer.End, LogicalDirection.Backward)) != 0) 964if (position.CompareTo(GetInsertionPosition(position.TextContainer.Start, LogicalDirection.Forward)) != 0) 994LogicalDirection direction = (count > 0) ? LogicalDirection.Forward : LogicalDirection.Backward; 1051if (direction == LogicalDirection.Backward) 1053while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) 1055if (!position.MoveToNextContextPosition(LogicalDirection.Backward)) 1075position.SetLogicalDirection(LogicalDirection.Forward); 1092position.MoveToNextInsertionPosition(LogicalDirection.Backward); 1097MoveToInsertionPosition(position, LogicalDirection.Forward); 1112position.MoveToPosition(direction == LogicalDirection.Forward ? paragraphRange.End : paragraphRange.Start); 1143if (direction == LogicalDirection.Backward) 1146MoveToInsertionPosition(position, LogicalDirection.Backward); 1151MoveToInsertionPosition(position, LogicalDirection.Forward); 1163if (direction == LogicalDirection.Forward) 1196return (direction == LogicalDirection.Forward) ? moved : -moved; 1211while (IsElementBoundary(start.GetPointerContext(LogicalDirection.Forward))) 1213if (!start.MoveToNextContextPosition(LogicalDirection.Forward) || start.CompareTo(end) >= 0) 1218while (IsElementBoundary(end.GetPointerContext(LogicalDirection.Backward))) 1220if (!end.MoveToNextContextPosition(LogicalDirection.Backward) || start.CompareTo(end) >= 0) 1235if (!start.MoveToNextContextPosition(LogicalDirection.Forward) || start.CompareTo(end) > 0) 1446return TextPointerBase.IsAtWordBoundary(position, LogicalDirection.Forward); 1454private static bool MoveToNextWordBoundary(ITextPointer position, LogicalDirection direction) 1480position.SetLogicalDirection(LogicalDirection.Forward); 1505private ITextPointer GetInsertionPosition(ITextPointer position, LogicalDirection direction) 1638_end.MoveToNextInsertionPosition(LogicalDirection.Forward); 1673ITextPointer position = _end.CreatePointer(LogicalDirection.Backward); 1684attrEnd = position.CreatePointer(LogicalDirection.Backward); 1691attrStart = position.CreatePointer(LogicalDirection.Forward); 1695if (!position.MoveToNextContextPosition(LogicalDirection.Backward)) 1704ITextPointer position = _start.CreatePointer(LogicalDirection.Forward); 1715attrStart = position.CreatePointer(LogicalDirection.Forward); 1722attrEnd = position.CreatePointer(LogicalDirection.Backward); 1726if (!position.MoveToNextContextPosition(LogicalDirection.Forward)) 1909_end.MoveToNextInsertionPosition(LogicalDirection.Forward); 1947if (MoveToUnitBoundary(position, start, count < 0 ? LogicalDirection.Backward : LogicalDirection.Forward, unit))
System\Windows\Documents\BlockUIContainer.cs (1)
72return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement;
System\Windows\Documents\ColumnResizeUndoUnit.cs (1)
46textPointerTable = new TextPointer(_textContainer.Start, _cpTable, LogicalDirection.Forward);
System\Windows\Documents\CompositionAdorner.cs (12)
327ITextPointer rangeStart = start.CreatePointer(LogicalDirection.Forward); 328ITextPointer rangeEnd = end.CreatePointer(LogicalDirection.Backward); 484ITextPointer start = _textView.TextContainer.Start.CreatePointer(_startOffset, LogicalDirection.Forward); 485ITextPointer end = _textView.TextContainer.Start.CreatePointer(_endOffset, LogicalDirection.Backward); 487while (start.CompareTo(end) < 0 && start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 489start.MoveToNextContextPosition(LogicalDirection.Forward); 492Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 606endLinePointer = textSegment.End.CreatePointer(LogicalDirection.Backward); 621startLinePointer = textSegment.End.CreatePointer(LogicalDirection.Forward); 626while ((startLinePointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) && 627(startLinePointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text)) 629startLinePointer.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (3)
50internal override object GetHighlightValue(StaticTextPointer staticTextPointer, LogicalDirection direction) 58internal override bool IsContentHighlighted(StaticTextPointer staticTextPointer, LogicalDirection direction) 65internal override StaticTextPointer GetNextChangePosition(StaticTextPointer staticTextPointer, LogicalDirection direction)
System\Windows\Documents\DocumentSequenceTextContainer.cs (25)
95ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 101ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 106ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 113return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 116TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 126int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 131object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 146StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 660if (!highlights.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 662highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 670selected = highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)); 674highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 681if (highlightRangeStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 688TextPointerBase.GetTextWithLimit(highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), LogicalDirection.Forward, sb, 0, 256, highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward)); 863internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 884internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 906internal override StaticTextPointer GetNextHighlightChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 949internal override StaticTextPointer GetNextPropertyChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 974private bool EnsureParentPosition(StaticTextPointer textPosition, LogicalDirection direction, out StaticTextPointer parentPosition) 988ITextPointer dynamicTextPointer = textPosition.CreateDynamicTextPointer(LogicalDirection.Forward); 1006private StaticTextPointer GetStaticPositionInChildContainer(StaticTextPointer textPosition, LogicalDirection direction, StaticTextPointer originalPosition) 1012DocumentSequenceTextPointer parentChangePosition = textPosition.CreateDynamicTextPointer(LogicalDirection.Forward) as DocumentSequenceTextPointer; 1025childTp = direction == LogicalDirection.Forward ?
System\Windows\Documents\DocumentSequenceTextPointer.cs (52)
47void ITextPointer.SetLogicalDirection(LogicalDirection direction) 80TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 89int ITextPointer.GetTextRunLength(LogicalDirection direction) 95string ITextPointer.GetTextInRun(LogicalDirection direction) 101/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 104int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 113object ITextPointer.GetAdjacentElement(LogicalDirection direction) 122Type ITextPointer.GetElementType(LogicalDirection direction) 190/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 192ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 198/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 200ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 214ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 243ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 258ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 269ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 278ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 359if (!isAtCaretUnitBoundary && ((ITextPointer)this).LogicalDirection == LogicalDirection.Backward) 367ITextPointer positionForwardGravity = ((ITextPointer)this).CreatePointer(LogicalDirection.Forward); 377LogicalDirection ITextPointer.LogicalDirection 442bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 475LogicalDirection gravity = this.ChildPointer.LogicalDirection; 505Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 510bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 515bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 630public static TextPointerContext GetPointerContext(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 641public static int GetTextRunLength(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 649/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 652public static int GetTextInRun(DocumentSequenceTextPointer thisTp, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 681public static object GetAdjacentElement(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 692public static Type GetElementType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 765public static ITextPointer CreatePointer(DocumentSequenceTextPointer thisTp, LogicalDirection gravity) 771/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 773public static ITextPointer CreatePointer(DocumentSequenceTextPointer thisTp, int distance, LogicalDirection gravity) 818internal static bool iScan(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 823moved = xGapAwareScan(thisTp, (direction == LogicalDirection.Forward ? 1 : -1)); 863private static DocumentSequenceTextPointer xGetClingDSTP(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 875if (direction == LogicalDirection.Forward) 888Debug.Assert(direction == LogicalDirection.Backward); 913private static TextPointerContext xGapAwareGetSymbolType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 920private static object xGapAwareGetEmbeddedElement(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 964if (tp1.ChildPointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None || 965tp2.ChildPointer.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.None) 974if (block.ChildContainer.Start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) 1029LogicalDirection scanDir = (distance > 0 ? LogicalDirection.Forward : LogicalDirection.Backward); 1057if (scanDir == LogicalDirection.Backward) 1065if (!((cdb.IsHead && scanDir == LogicalDirection.Backward) 1066|| (cdb.IsTail && scanDir == LogicalDirection.Forward) 1070cdb = (scanDir == LogicalDirection.Forward ? cdb.NextBlock : cdb.PreviousBlock); 1071childTn = (scanDir == LogicalDirection.Forward ?
System\Windows\Documents\DocumentSequenceTextView.cs (5)
74LogicalDirection edge = LogicalDirection.Forward; 205LogicalDirection newEdge = LogicalDirection.Forward; 298internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
System\Windows\Documents\FixedDocument.cs (11)
498fixedTextPointer = new FixedTextPointer(true, LogicalDirection.Forward, flowPosition); 1071if (!highlights.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 1073highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1084selected = highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)); 1102highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1105while (highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)) != DependencyProperty.UnsetValue); 1114LogicalDirection.Forward, typeof(HighlightComponent)) as AnnotationHighlightLayer.HighlightSegment; 1118highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1128this.FixedContainer.GetMultiHighlights((FixedTextPointer)highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), 1129(FixedTextPointer)highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward), 1434return new FixedTextPointer(true, LogicalDirection.Forward, flowPosition);
System\Windows\Documents\FixedElement.cs (6)
267TextPointerContext tpc = pos.GetPointerContext(LogicalDirection.Forward); 270root.AddText(pos.GetTextInRun(LogicalDirection.Forward)); 274root.AddChild(pos.GetAdjacentElement(LogicalDirection.Forward)); 278object obj = pos.GetAdjacentElement(LogicalDirection.Forward); 282pos.MoveToNextContextPosition(LogicalDirection.Forward); 287pos.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\FixedFindEngine.cs (12)
151end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber))); 152start = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Forward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageStartFlowPosition(translatedPageNumber))); 156start = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Forward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageStartFlowPosition(translatedPageNumber))); 157end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber))); 166end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber)); 167start = new FixedTextPointer(false, LogicalDirection.Forward, textBuilder.GetPageStartFlowPosition(pageNumber)); 171start = new FixedTextPointer(false, LogicalDirection.Forward, textBuilder.GetPageStartFlowPosition(pageNumber)); 172end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber)); 304new FixedTextPointer(false, LogicalDirection.Forward,pageStartFlowPosition)); 310firstSearchPageStart = new FixedTextPointer(false, LogicalDirection.Forward, endAsFTP.FixedTextContainer.FixedTextBuilder.GetPageStartFlowPosition(pageNumber)); 324new FixedTextPointer(false, LogicalDirection.Backward, pageEndFlowPosition)); 330firstSearchPageEnd = new FixedTextPointer(false, LogicalDirection.Backward, startAsFTP.FixedTextContainer.FixedTextBuilder.GetPageEndFlowPosition(pageNumber));
System\Windows\Documents\FixedTextBuilder.cs (2)
387internal bool GetFixedPosition(FlowPosition position, LogicalDirection textdir, out FixedPosition fixedp) 421textdir == LogicalDirection.Backward &&
System\Windows\Documents\FixedTextContainer.cs (12)
80ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 86ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 91ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 98return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 101TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 111int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 116object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 131StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 569_start = new FixedTextPointer(false, LogicalDirection.Backward, new FlowPosition(this, this.FixedTextBuilder.FixedFlowMap.FlowStartEdge, 1)); 570_end = new FixedTextPointer(false, LogicalDirection.Forward, new FlowPosition(this, this.FixedTextBuilder.FixedFlowMap.FlowEndEdge, 0)); 579FixedTextPointer eStart = new FixedTextPointer(false, LogicalDirection.Backward, pStart); 580FixedTextPointer eEnd = new FixedTextPointer(false, LogicalDirection.Forward, pEnd);
System\Windows\Documents\FixedTextPointer.cs (27)
31internal FixedTextPointer(bool mutable, LogicalDirection gravity, FlowPosition flow) 93TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 103int ITextPointer.GetTextRunLength(LogicalDirection direction) 114string ITextPointer.GetTextInRun(LogicalDirection direction) 120/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 123int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 143object ITextPointer.GetAdjacentElement(LogicalDirection direction) 158Type ITextPointer.GetElementType(LogicalDirection direction) 259/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 261ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 267/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 269ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 293ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 302ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 320ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 334ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 346ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 366void ITextPointer.SetLogicalDirection(LogicalDirection direction) 376bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 463Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 471bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 479bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 569if (!isAtCaretUnitBoundary && this.LogicalDirection == LogicalDirection.Backward) 577ITextPointer positionForwardGravity = ((ITextPointer)this).CreatePointer(LogicalDirection.Forward); 587LogicalDirection ITextPointer.LogicalDirection 662internal LogicalDirection LogicalDirection 695private LogicalDirection _gravity;
System\Windows\Documents\FixedTextView.cs (43)
75textPos = _CreateTextPointer(fixedp, LogicalDirection.Backward); 98pos = _CreateTextPointer(fixedp, LogicalDirection.Forward); 105pos = _CreateTextPointer(fixedp, LogicalDirection.Forward); 176if (position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) 335LogicalDirection edge = position.LogicalDirection; 336LogicalDirection scanDir = LogicalDirection.Forward; 357scanDir = LogicalDirection.Backward; 371linesMoved = (scanDir == LogicalDirection.Forward) ? 1 : -1; 396if (scanDir == LogicalDirection.Backward) 502internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 518CharacterHit next = (direction == LogicalDirection.Forward) ? 524LogicalDirection edge = LogicalDirection.Forward; 527edge = LogicalDirection.Backward; 605ITextPointer begin = _CreateTextPointer(new FixedPosition(fixedNodes[0], 0), LogicalDirection.Forward); 606ITextPointer end = _CreateTextPointer(new FixedPosition(lastNode, lastIndex), LogicalDirection.Backward); 638(tp.CompareTo(this.Start) == 0 && (tp.LogicalDirection == LogicalDirection.Forward || this.IsContainerStart)) || 639(tp.CompareTo(this.End) == 0 && (tp.LogicalDirection == LogicalDirection.Backward || this.IsContainerEnd)) 733_start = new FixedTextPointer(false, LogicalDirection.Forward, flowStart); 746_end = new FixedTextPointer(false, LogicalDirection.Backward, flowEnd); 785private void _GlyphRunHitTest(Glyphs g, double xoffset, out int charIndex, out LogicalDirection edge) 788edge = LogicalDirection.Forward; 806edge = (hit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 849LogicalDirection dir; 863itp = ((ITextPointer)this.Start).CreatePointer(LogicalDirection.Forward); 864itp.MoveToInsertionPosition(LogicalDirection.Forward); 868itp = ((ITextPointer)this.End).CreatePointer(LogicalDirection.Backward); 869itp.MoveToInsertionPosition(LogicalDirection.Backward); 878private bool _GetNextLineGlyphs(ref FixedPosition fixedp, ref LogicalDirection edge, double suggestedX, LogicalDirection scanDir) 883FixedNode[] fixedNodes = Container.FixedTextBuilder.GetNextLine(fixedp.Node, (scanDir == LogicalDirection.Forward), ref count); 1076LogicalDirection textdir = ftp.LogicalDirection; 1090textdir = LogicalDirection.Forward; 1093textdir = LogicalDirection.Backward; 1130LogicalDirection dir = LogicalDirection.Forward; 1134dir = LogicalDirection.Backward; 1163private ITextPointer _CreateTextPointer(FixedPosition fixedPosition, LogicalDirection edge) 1188LogicalDirection edge; 1198LogicalDirection dir = textPointer.LogicalDirection; 1199int increment = (dir == LogicalDirection.Forward ? +1 : -1);
System\Windows\Documents\FlowDocument.cs (1)
1491segmentEnd = args.ITextPosition.CreatePointer(args.Count, LogicalDirection.Forward);
System\Windows\Documents\FlowPosition.cs (30)
162int scan = flowScan._vScan(LogicalDirection.Forward, -1); 172internal TextPointerContext GetPointerContext(LogicalDirection dir) 174Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 180internal int GetTextRunLength(LogicalDirection dir) 185if (dir == LogicalDirection.Forward) 197internal int GetTextInRun(LogicalDirection dir, int maxLength, char[] chars, int startIndex) 206if (dir == LogicalDirection.Forward) 223if (dir == LogicalDirection.Forward) 236internal object GetAdjacentElement(LogicalDirection dir) 269internal FixedElement GetElement(LogicalDirection dir) 285(tst = flowScan.GetPointerContext(LogicalDirection.Backward))!= TextPointerContext.None) 291FlowPosition flowEnd = flowScan.GetClingPosition(LogicalDirection.Backward); 301flowScan.Move(LogicalDirection.Backward); 310LogicalDirection dir = (distance >= 0 ? LogicalDirection.Forward : LogicalDirection.Backward); 332internal bool Move(LogicalDirection dir) 360internal void GetFlowNode(LogicalDirection direction, out FlowNode flowNode, out int offsetStart) 376FlowPosition flowScan = GetClingPosition(LogicalDirection.Forward); 384int scan = flowScan._vScan(LogicalDirection.Forward, distance); 397internal FlowPosition GetClingPosition(LogicalDirection dir) 402if (dir == LogicalDirection.Forward) 424Debug.Assert(dir == LogicalDirection.Backward); 545private int _vScan(LogicalDirection dir, int limit) 554if (dir == LogicalDirection.Forward) 582Debug.Assert(dir == LogicalDirection.Backward); 613private TextPointerContext _vGetSymbolType(LogicalDirection dir) 616if (dir == LogicalDirection.Forward) 632Debug.Assert(dir == LogicalDirection.Backward);
System\Windows\Documents\FrameworkRichTextComposition.cs (4)
45return _ResultStart == null ? null : (TextPointer)_ResultStart.GetFrozenPointer(LogicalDirection.Backward); 56return _ResultEnd == null ? null : (TextPointer)_ResultEnd.GetFrozenPointer(LogicalDirection.Forward); 67return _CompositionStart == null ? null : (TextPointer)_CompositionStart.GetFrozenPointer(LogicalDirection.Backward); 78return _CompositionEnd == null ? null : (TextPointer)_CompositionEnd.GetFrozenPointer(LogicalDirection.Forward);
System\Windows\Documents\FrameworkTextComposition.cs (4)
195_resultStart = start.GetFrozenPointer(LogicalDirection.Backward); 196_resultEnd = end.GetFrozenPointer(LogicalDirection.Forward); 216_compositionStart = start.GetFrozenPointer(LogicalDirection.Backward); 217_compositionEnd = end.GetFrozenPointer(LogicalDirection.Forward);
System\Windows\Documents\HighlightLayer.cs (3)
40internal abstract object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction); 51internal abstract bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction); 63internal abstract StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction);
System\Windows\Documents\Highlights.cs (11)
60internal virtual object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 93internal virtual bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 118internal virtual StaticTextPointer GetNextHighlightChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 137else if (direction == LogicalDirection.Forward) 175internal virtual StaticTextPointer GetNextPropertyChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 188characterRunEndPosition = textPosition.GetNextContextPosition(LogicalDirection.Forward); 353if (!highlightLayer.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 355highlightTransitionPosition = highlightLayer.GetNextChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 363highlightTransitionPosition = highlightLayer.GetNextChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 366ranges.Add(new TextSegment(highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward)));
System\Windows\Documents\Hyperlink.cs (2)
105Hyperlink hyperlink = navigator.GetAdjacentElement(LogicalDirection.Forward) as Hyperlink; 113navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\ImmComposition.cs (25)
625caretNavigator = _caretOffset > 0 ? _startComposition.CreatePointer(_caretOffset, LogicalDirection.Forward) : _endComposition; 632ITextPointer startPosition = startNavigator.CreatePointer(LogicalDirection.Forward); 633ITextPointer endPosition = endNavigator.CreatePointer(LogicalDirection.Backward); 634ITextPointer caretPosition = caretNavigator.CreatePointer(LogicalDirection.Forward); 754rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 1124start = range.Start.CreatePointer(resultLength, LogicalDirection.Forward); 1128ITextPointer caretPosition = _caretOffset >= 0 ? start.CreatePointer(_caretOffset, LogicalDirection.Forward) : end; 1167ITextPointer startAttribute = _startComposition.CreatePointer(startOffset, LogicalDirection.Backward); 1168ITextPointer endAttribute = _startComposition.CreatePointer(i + 1, LogicalDirection.Forward); 1398switch (navigator.GetPointerContext(LogicalDirection.Backward)) 1402int copied = navigator.GetTextInRun(LogicalDirection.Backward, buffer, 0, buffer.Length); 1416if (!navigator.GetElementType(LogicalDirection.Backward).IsSubclassOf(typeof(Inline))) 1420navigator.MoveToNextContextPosition(LogicalDirection.Backward); 1429navigator.MoveToNextContextPosition(LogicalDirection.Backward); 1450switch (navigator.GetPointerContext(LogicalDirection.Forward)) 1454int copied = navigator.GetTextInRun(LogicalDirection.Forward, buffer, 0, buffer.Length); 1467if (!navigator.GetElementType(LogicalDirection.Forward).IsSubclassOf(typeof(Inline))) 1471navigator.MoveToNextContextPosition(LogicalDirection.Forward); 1479navigator.MoveToNextContextPosition(LogicalDirection.Forward); 1522ITextPointer start = range.Start.CreatePointer(LogicalDirection.Backward); 1527ITextPointer end = start.CreatePointer(LogicalDirection.Forward); 1549switch (position.GetPointerContext(LogicalDirection.Backward)) 1565switch (position.GetPointerContext(LogicalDirection.Forward)) 1652positionNext.MoveToNextInsertionPosition(LogicalDirection.Forward); 1656positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward);
System\Windows\Documents\InlineUIContainer.cs (1)
105return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement;
System\Windows\Documents\ITextContainer.cs (7)
37ITextPointer CreatePointerAtOffset(int offset, LogicalDirection direction); 42ITextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction); 44ITextPointer CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction); 48TextPointerContext GetPointerContext(StaticTextPointer pointer, LogicalDirection direction); 52int GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count); 54object GetAdjacentElement(StaticTextPointer position, LogicalDirection direction); 60StaticTextPointer GetNextContextPosition(StaticTextPointer position, LogicalDirection direction);
System\Windows\Documents\ITextPointer.cs (19)
33ITextPointer CreatePointer(LogicalDirection gravity); 36ITextPointer CreatePointer(int offset, LogicalDirection gravity); 39void SetLogicalDirection(LogicalDirection direction); 52TextPointerContext GetPointerContext(LogicalDirection direction); 58int GetTextRunLength(LogicalDirection direction); 61string GetTextInRun(LogicalDirection direction); 64int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count); 71object GetAdjacentElement(LogicalDirection direction); 80bool MoveToNextContextPosition(LogicalDirection direction); 83ITextPointer GetNextContextPosition(LogicalDirection direction); 86bool MoveToInsertionPosition(LogicalDirection direction); 89ITextPointer GetInsertionPosition(LogicalDirection direction); 92ITextPointer GetFormatNormalizedPosition(LogicalDirection direction); 95bool MoveToNextInsertionPosition(LogicalDirection direction); 98ITextPointer GetNextInsertionPosition(LogicalDirection direction); 107Rect GetCharacterRect(LogicalDirection direction); 113ITextPointer GetFrozenPointer(LogicalDirection logicalDirection); 123Type GetElementType(LogicalDirection direction); 173LogicalDirection LogicalDirection { get; }
System\Windows\Documents\ITextSelection.cs (3)
60void SetCaretToPosition(ITextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace); 71bool ExtendToNextInsertionPosition(LogicalDirection direction); 130bool ExtendToNextTableRow(LogicalDirection direction);
System\Windows\Documents\ITextView.cs (1)
276ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction);
System\Windows\Documents\List.cs (5)
194if (textNav.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 196DependencyObject element = textNav.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 214textNav.MoveToNextContextPosition(LogicalDirection.Forward); 250listItem = block.ElementStart.GetAdjacentElement(LogicalDirection.Backward) as ListItem; 278block = block == lastBlock ? null : (Block)listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward);
System\Windows\Documents\NullTextContainer.cs (10)
35_start = new NullTextPointer(this, LogicalDirection.Backward); 36_end = new NullTextPointer(this, LogicalDirection.Forward); 80ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 86ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 91ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 98return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 101TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 111int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 116object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 131StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction)
System\Windows\Documents\NullTextNavigator.cs (25)
27internal NullTextPointer(NullTextContainer container, LogicalDirection gravity) 69TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 79int ITextPointer.GetTextRunLength(LogicalDirection direction) 86/// <see cref="ITextPointer.GetTextInRun(LogicalDirection)"/> 88string ITextPointer.GetTextInRun(LogicalDirection direction) 94/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 97int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 107object ITextPointer.GetAdjacentElement(LogicalDirection direction) 117Type ITextPointer.GetElementType(LogicalDirection direction) 181/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 183ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 189/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 191ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 207ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 220void ITextPointer.SetLogicalDirection(LogicalDirection direction) 231bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 284Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 293bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 301bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 326ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 344ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 358ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 370ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 452LogicalDirection ITextPointer.LogicalDirection 507private LogicalDirection _gravity;
System\Windows\Documents\Paragraph.cs (2)
253TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 261navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\RangeContentEnumerator.cs (13)
94switch (_navigator.GetPointerContext(LogicalDirection.Forward)) 102runLength = _navigator.GetTextRunLength(LogicalDirection.Forward); 104_navigator.GetTextInRun(LogicalDirection.Forward, _buffer, offset, runLength); 106_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 108while (_navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 116_currentCache = _navigator.GetAdjacentElement(LogicalDirection.Forward); 119_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 124_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 170switch (_navigator.GetPointerContext(LogicalDirection.Forward)) 177_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 179while (_navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text && _navigator.CompareTo(_end) < 0); 184_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 189_navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\RubberbandSelector.cs (1)
331return new FixedTextPointer(false, LogicalDirection.Forward, flowHit);
System\windows\Documents\SelectionWordBreaker.cs (2)
48internal static bool IsAtWordBoundary(char[] text, int position, LogicalDirection insideWordDirection) 53if (insideWordDirection == LogicalDirection.Backward)
System\Windows\Documents\Span.cs (4)
223if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 225position = position.GetNextContextPosition(LogicalDirection.Backward); 227else if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 229position = position.GetNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\Speller.cs (46)
107internal SpellingError GetError(ITextPointer position, LogicalDirection direction, bool forceEvaluation) 141internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, LogicalDirection direction) 190ExpandToWordBreakAndContext(error.Start, LogicalDirection.Backward, language, out ITextPointer contentStart, out ITextPointer contextStart); 191ExpandToWordBreakAndContext(error.End, LogicalDirection.Forward, language, out ITextPointer contentEnd, out ITextPointer contextEnd); 236if (_statusTable.GetError(pointer, LogicalDirection.Forward, out errorStart, out errorEnd)) 246pointer = _statusTable.GetNextErrorTransition(pointer, LogicalDirection.Forward); 666end = GetNextLanguageTransition(start, LogicalDirection.Forward, language, end); 707wordBreakLeft = SearchForWordBreaks(caretPosition, LogicalDirection.Backward, language, 1, false /* stopOnError */); 708wordBreakRight = SearchForWordBreaks(caretPosition, LogicalDirection.Forward, language, 1, false /* stopOnError */); 723FindPositionInSegmentList(textMap, LogicalDirection.Backward, segments, out leftBreakOffset, out rightBreakOffset); 793ExpandToWordBreakAndContext(start, LogicalDirection.Backward, language, out contentStart, out contextStart); 794ExpandToWordBreakAndContext(end, LogicalDirection.Forward, language, out contentEnd, out contextEnd); 1085private void ExpandToWordBreakAndContext(ITextPointer position, LogicalDirection direction, XmlLanguage language, 1095LogicalDirection inwardDirection; 1121inwardDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 1127if (direction == LogicalDirection.Backward) 1162if (direction == LogicalDirection.Backward) 1179if (direction == LogicalDirection.Backward) 1206if (direction == LogicalDirection.Backward) 1235private int FindPositionInSegmentList(TextMap textMap, LogicalDirection direction, ArrayList segments, 1294if (direction == LogicalDirection.Backward) 1315private ITextPointer SearchForWordBreaks(ITextPointer position, LogicalDirection direction, XmlLanguage language, int minWordCount, bool stopOnError) 1333closestErrorPosition = nextErrorTransition.CreateDynamicTextPointer(LogicalDirection.Forward); 1341searchPosition.MoveByOffset(direction == LogicalDirection.Backward ? -ContextBlockSize : +ContextBlockSize); 1346if (direction == LogicalDirection.Backward && closestErrorPosition.CompareTo(searchPosition) > 0 || 1347direction == LogicalDirection.Forward && closestErrorPosition.CompareTo(searchPosition) < 0) 1357if (direction == LogicalDirection.Backward && closestLanguageTransition.CompareTo(searchPosition) > 0 || 1358direction == LogicalDirection.Forward && closestLanguageTransition.CompareTo(searchPosition) < 0) 1364if (direction == LogicalDirection.Backward) 1387private ITextPointer GetNextLanguageTransition(ITextPointer position, LogicalDirection direction, XmlLanguage language, ITextPointer haltPosition) 1391while ((direction == LogicalDirection.Forward && navigator.CompareTo(haltPosition) < 0) || 1392(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) > 0)) 1401if ((direction == LogicalDirection.Forward && navigator.CompareTo(haltPosition) > 0) || 1402(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) < 0)) 1464private void ScanPosition(ITextPointer position, LogicalDirection direction) 1469if (direction == LogicalDirection.Forward) 1658_basePosition = contextStart.GetFrozenPointer(LogicalDirection.Backward); 1685switch (position.GetPointerContext(LogicalDirection.Forward)) 1688runCount = position.GetTextRunLength(LogicalDirection.Forward); 1692position.GetTextInRun(LogicalDirection.Forward, _text, _textLength, runCount); 1728position.MoveToNextContextPosition(LogicalDirection.Forward); 1736position.MoveToNextContextPosition(LogicalDirection.Forward); 1803context = pointer.GetPointerContext(LogicalDirection.Forward); 1806TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Forward)))
System\Windows\Documents\SpellerError.cs (2)
33_start = start.GetFrozenPointer(LogicalDirection.Forward); 34_end = end.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\SpellerHighlightLayer.cs (3)
52internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 69internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 76internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction)
System\Windows\Documents\SpellerStatusTable.cs (20)
91for (index = FindIndex(searchStart.CreateStaticPointer(), LogicalDirection.Forward); index >= 0 && index < _runList.Count; index++) 127runIndex = FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); 163internal bool IsRunType(StaticTextPointer textPosition, LogicalDirection direction, RunType runType) 178internal StaticTextPointer GetNextErrorTransition(StaticTextPointer textPosition, LogicalDirection direction) 193else if (direction == LogicalDirection.Forward) 243internal bool GetError(StaticTextPointer textPosition, LogicalDirection direction, 263internal bool GetRun(StaticTextPointer position, LogicalDirection direction, out RunType runType, out StaticTextPointer end) 278end = (direction == LogicalDirection.Forward) ? GetRunEndPosition(index) : run.Position.CreateStaticPointer(); 308private int GetErrorIndex(StaticTextPointer textPosition, LogicalDirection direction) 331private int FindIndex(StaticTextPointer position, LogicalDirection direction) 348if (direction == LogicalDirection.Forward && position.CompareTo(run.Position) < 0 || 349direction == LogicalDirection.Backward && position.CompareTo(run.Position) <= 0) 354else if (direction == LogicalDirection.Forward && position.CompareTo(GetRunEndPosition(index)) >= 0 || 355direction == LogicalDirection.Backward && position.CompareTo(GetRunEndPosition(index)) > 0) 391startIndex = FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); 392endIndex = FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); 427endIndex = FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); 592index = FindIndex(position.CreateStaticPointer(), LogicalDirection.Backward); 751return GetRunEndPosition(index).CreateDynamicTextPointer(LogicalDirection.Forward); 799_position = position.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\StaticTextPointer.cs (5)
45internal ITextPointer CreateDynamicTextPointer(LogicalDirection direction) 52internal TextPointerContext GetPointerContext(LogicalDirection direction) 66internal int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 73internal object GetAdjacentElement(LogicalDirection direction) 87internal StaticTextPointer GetNextContextPosition(LogicalDirection direction)
System\Windows\Documents\TextContainer.cs (36)
429ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 437internal TextPointer CreatePointerAtOffset(int offset, LogicalDirection direction) 446ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 460internal TextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 473ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 500TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 511else if (direction == LogicalDirection.Forward) 513edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 518edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward); 550int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 566object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 613StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 630edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd; 636TextTreeTextNode nextTextNode = ((direction == LogicalDirection.Forward) ? node.GetNextNode() : node.GetPreviousNode()) as TextTreeTextNode; 641edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd; 645else if (direction == LogicalDirection.Forward) 647edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 652edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward); 824LogicalDirection direction; 858originalPosition = this.HasListeners ? new TextPointer(position, LogicalDirection.Backward) : null; 870direction = LogicalDirection.Backward; 874direction = LogicalDirection.Forward; 883if ((direction == LogicalDirection.Backward && textNode.AfterEndReferenceCount) || 884(direction == LogicalDirection.Forward && textNode.BeforeStartReferenceCount)) 1044newFirstIMEVisibleNode = startPosition.GetAdjacentTextElementNodeSibling(LogicalDirection.Forward); 1266deletePosition = new TextPointer(startPosition, LogicalDirection.Forward); 1592if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward) 1600TextPointer positionForwardGravity = position.GetPositionAtOffset(0, LogicalDirection.Forward); 1635startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward); 1666endPosition = new TextPointer(this, _rootNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 2432node = startPosition.GetAdjacentSiblingNode(LogicalDirection.Forward); 2433stopNode = endPosition.GetAdjacentSiblingNode(LogicalDirection.Forward); 2788startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward); 2793endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward); 3417TextElement adjacentElement = startPosition.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 3420nextIMEVisibleNode = (TextTreeTextElementNode)endPosition.GetAdjacentSiblingNode(LogicalDirection.Forward);
System\Windows\Documents\TextContainerChangeEventArgs.cs (1)
32_textPosition = textPosition.GetFrozenPointer(LogicalDirection.Forward);
System\windows\Documents\TextEditor.cs (5)
402internal SpellingError GetSpellingErrorAtPosition(ITextPointer position, LogicalDirection direction) 414internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, LogicalDirection direction) 1209string textAdjacent = textContainer.TextSelection.AnchorPosition.GetTextInRun(LogicalDirection.Backward); 1506if (cursorPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null && 1510lastCharacterRect = cursorPosition.GetCharacterRect(LogicalDirection.Backward);
System\windows\Documents\TextEditorContextMenu.cs (7)
170LogicalDirection direction; 181direction = LogicalDirection.Backward; 189direction = LogicalDirection.Forward; 193direction = LogicalDirection.Forward; 259private static void GetClippedPositionOffsets(TextEditor This, ITextPointer position, LogicalDirection direction, 400while (position.GetAdjacentElement(LogicalDirection.Forward) is Inline) 402position = position.GetNextContextPosition(LogicalDirection.Forward);
System\windows\Documents\TextEditorCopyPaste.cs (3)
398This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 951start = start.GetPositionAtOffset(0, LogicalDirection.Backward); 952TextPointer end = start.GetPositionAtOffset(0, LogicalDirection.Forward);
System\windows\Documents\TextEditorDragDrop.cs (5)
464!TextPointerBase.IsAtWordBoundary(dropPosition, /*insideWordDirection:*/LogicalDirection.Forward) && 467TextPointerBase.IsAtWordBoundary(_dragSourceTextRange.Start, LogicalDirection.Forward) && // 468TextPointerBase.IsAtWordBoundary(_dragSourceTextRange.End, LogicalDirection.Forward)) 548selection.SetCaretToPosition(dropPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 576selection.SetCaretToPosition(dropPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true);
System\windows\Documents\TextEditorMouse.cs (6)
561if (snappedCursorPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null && 565Rect lastCharacterRect = snappedCursorPosition.GetCharacterRect(LogicalDirection.Backward); 735LogicalDirection otherEdgeDirection = (mouseMovePosition.LogicalDirection == LogicalDirection.Forward) ? 736LogicalDirection.Backward : LogicalDirection.Forward;
System\windows\Documents\TextEditorSelection.cs (91)
113ITextPointer lineStart = position.CreatePointer(LogicalDirection.Forward); 115ITextPointer lineEnd = position.CreatePointer(LogicalDirection.Backward); 188LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 204LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 221LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 237LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 313ITextPointer nextPosition = lineEndPosition.GetNextInsertionPosition(LogicalDirection.Forward); 403ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward); 464if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Forward)) 468This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 473This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 517This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 522if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward)) 526This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 803ITextPointer caretPosition = lineRange.Start.GetFrozenPointer(LogicalDirection.Forward); 806This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 852LogicalDirection orientation = TextPointerBase.IsNextToPlainLineBreak(lineRange.End, LogicalDirection.Backward) ? LogicalDirection.Forward : LogicalDirection.Backward; 886This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 915This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 946LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 962LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 978LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 994LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 1012if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1070ITextPointer nextPosition = lineEndPosition.GetNextInsertionPosition(LogicalDirection.Forward); 1122if (TextPointerBase.IsNextToAnyBreak(newMovingPosition, LogicalDirection.Forward) || 1123newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null) 1132newMovingPosition = newMovingPosition.GetInsertionPosition(LogicalDirection.Forward); 1133newMovingPosition = newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward); 1142newMovingPosition = newMovingPosition.GetFrozenPointer(LogicalDirection.Backward); 1160if (newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null) 1184if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1260ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward); 1321if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Forward)) 1369if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward)) 1603ExtendSelectionAndBringIntoView(lineRange.Start.CreatePointer(LogicalDirection.Forward), This); 1655if (TextPointerBase.IsNextToPlainLineBreak(destination, LogicalDirection.Forward) || 1656TextPointerBase.IsNextToRichLineBreak(destination, LogicalDirection.Forward)) 1665destination = destination.GetNextInsertionPosition(LogicalDirection.Forward); 1669else if (TextPointerBase.IsNextToParagraphBreak(destination, LogicalDirection.Forward) && 1670TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1674ITextPointer newDestination = destination.GetNextInsertionPosition(LogicalDirection.Forward); 1688destination = destination.GetFrozenPointer(LogicalDirection.Backward); 2037private static void MoveToCharacterLogicalDirection(TextEditor textEditor, LogicalDirection direction, bool extend) 2057ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2067LogicalDirection contentDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 2098private static void NavigateWordLogicalDirection(TextEditor textEditor, LogicalDirection direction) 2115if (direction == LogicalDirection.Forward) 2118if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2121textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2128TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Forward); 2130textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2138if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2141textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2148TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward); 2150textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2173private static void ExtendWordLogicalDirection(TextEditor textEditor, LogicalDirection direction) 2194wordBoundary.SetLogicalDirection(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward); 2306movingPosition.LogicalDirection == LogicalDirection.Backward && 2308TextPointerBase.IsNextToAnyBreak(movingPosition, LogicalDirection.Backward)) 2310movingPosition = movingPosition.GetNextInsertionPosition(LogicalDirection.Backward); 2314if (TextPointerBase.IsNextToPlainLineBreak(movingPosition, LogicalDirection.Backward)) 2316movingPosition = movingPosition.GetFrozenPointer(LogicalDirection.Forward); 2333return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2396ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2399This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2412ITextPointer cellEnd = position.GetNextInsertionPosition(LogicalDirection.Backward);
System\windows\Documents\TextEditorSpelling.cs (22)
36internal static SpellingError GetSpellingErrorAtPosition(TextEditor This, ITextPointer position, LogicalDirection direction) 59LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 67direction = (direction == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 82direction = (direction == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 87direction = LogicalDirection.Forward; 91direction = LogicalDirection.Backward; 101internal static ITextPointer GetNextSpellingErrorPosition(TextEditor This, ITextPointer position, LogicalDirection direction) 148caretPosition = textStart.CreatePointer(+correctedText.Length, LogicalDirection.Forward); 184textStart = spellingError.Start.CreatePointer(LogicalDirection.Backward); 186textStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 188textStart.MoveToNextContextPosition(LogicalDirection.Forward); 192textEnd.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text) 194textEnd.MoveToNextContextPosition(LogicalDirection.Backward); 197if (textStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text || 202Invariant.Assert(textEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 253private static ITextPointer GetNextTextPosition(ITextPointer position, ITextPointer limit, LogicalDirection direction, out char character) 316position = GetNextTextPosition(position, limit, LogicalDirection.Forward, out character);
System\windows\Documents\TextEditorTyping.cs (36)
543ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Forward); 566This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 620ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Backward); 645position = position.GetFrozenPointer(LogicalDirection.Backward); 652position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) 674This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 682else if (backspacePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text) 691This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 723This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 739LogicalDirection directionOfDelete = position.CompareTo(deletePosition) < 0 ? LogicalDirection.Forward : LogicalDirection.Backward; 746if (directionOfDelete == LogicalDirection.Forward) 773if (directionOfDelete == LogicalDirection.Backward) 810position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 811position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 816while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 823position = position.GetNextContextPosition(LogicalDirection.Backward); 824if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 832position = position.GetNextContextPosition(LogicalDirection.Backward); 843if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart) 849position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementEnd) 857while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 864if (!(navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 913TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Forward); 972TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward); 1081This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1172This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1344if (HandleTabInTables(This, LogicalDirection.Forward)) 1376if (HandleTabInTables(This, LogicalDirection.Backward)) 1397private static bool HandleTabInTables(TextEditor This, LogicalDirection direction) 1408This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1421if (direction == LogicalDirection.Forward) 1458if (direction == LogicalDirection.Forward) 1556ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1559This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
System\Windows\Documents\TextEffectResolver.cs (4)
101while (navigator.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text 102&& navigator.MoveToNextContextPosition(LogicalDirection.Forward)) ; 111while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text 113&& navigator.MoveToNextContextPosition(LogicalDirection.Forward)) ;
System\Windows\Documents\TextElement.cs (7)
288TextPointer contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward); 291TextPointer contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 314elementStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward); 347contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward); 380contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 421elementEnd = new TextPointer(tree, _textElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward); 994beforeStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
System\Windows\Documents\TextElementEnumerator.cs (3)
126_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 131Invariant.Assert(_navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, 135_navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\TextFindEngine.cs (17)
184LogicalDirection direction; 193direction = LogicalDirection.Backward; 198direction = LogicalDirection.Forward; 303hasPreceedingSeparatorChar = HasNeighboringSeparatorChar(oppositeEndPosition, LogicalDirection.Backward); 304hasFollowingSeparatorChar = HasNeighboringSeparatorChar(position, LogicalDirection.Forward); 308hasPreceedingSeparatorChar = HasNeighboringSeparatorChar(position, LogicalDirection.Backward); 309hasFollowingSeparatorChar = HasNeighboringSeparatorChar(oppositeEndPosition, LogicalDirection.Forward); 315private static bool HasNeighboringSeparatorChar(ITextPointer position, LogicalDirection direction) 340LogicalDirection.Forward, 352if (direction == LogicalDirection.Forward) 637LogicalDirection direction, 887private static bool IsAdjacentToFormatElement(ITextPointer pointer, LogicalDirection direction) 894if (direction == LogicalDirection.Forward) 896context = pointer.GetPointerContext(LogicalDirection.Forward); 899TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Forward))) 911context = pointer.GetPointerContext(LogicalDirection.Backward); 914TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Backward)))
System\Windows\Documents\TextMapOffsetErrorLogger.cs (2)
58public TextMapOffsetErrorLogger(LogicalDirection direction, TextMap textMap, ArrayList segments, int positionInSegmentList, int leftWordBreak, int rightWordBreak, int contentOffset) 145/// string representation of a <see cref="LogicalDirection"/> instance.
System\Windows\Documents\TextParentUndoUnit.cs (4)
201private readonly LogicalDirection _undoAnchorPositionDirection; 204private readonly LogicalDirection _undoMovingPositionDirection; 207private LogicalDirection _redoAnchorPositionDirection; 210private LogicalDirection _redoMovingPositionDirection;
System\Windows\Documents\TextPointer.cs (97)
271internal TextPointer(TextPointer position, LogicalDirection direction) 277internal TextPointer(TextPointer position, int offset, LogicalDirection direction) 283internal TextPointer(TextContainer textContainer, int offset, LogicalDirection direction) 301Initialize(tree, node, edge, LogicalDirection.Forward, tree.PositionGeneration, false, false, tree.LayoutGeneration); 305internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection direction) 317internal TextPointer CreatePointer(LogicalDirection gravity) 496/// is <see cref="System.Windows.Documents.LogicalDirection.Backward"/>, or if it is positioned 498/// <see cref="System.Windows.Documents.LogicalDirection.Forward"/>.</para> 539public TextPointerContext GetPointerContext(LogicalDirection direction) 547return (direction == LogicalDirection.Forward) ? GetPointerContextForward(_node, this.Edge) : GetPointerContextBackward(_node, this.Edge); 561public int GetTextRunLength(LogicalDirection direction) 582if (direction == LogicalDirection.Forward) 598textNode = ((direction == LogicalDirection.Forward) ? textNode.GetNextNode() : textNode.GetPreviousNode()) as TextTreeTextNode; 732public string GetTextInRun(LogicalDirection direction) 770public int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 804public DependencyObject GetAdjacentElement(LogicalDirection direction) 897public TextPointer GetPositionAtOffset(int offset, LogicalDirection direction) 985public TextPointer GetNextContextPosition(LogicalDirection direction) 1058public TextPointer GetInsertionPosition(LogicalDirection direction) 1066return GetInsertionPosition(LogicalDirection.Forward); 1085/// "insertion position" in the <see cref="TextPointer.GetInsertionPosition(LogicalDirection)"/> 1125public TextPointer GetNextInsertionPosition(LogicalDirection direction) 1222position.SetLogicalDirection(LogicalDirection.Forward); 1243public Rect GetCharacterRect(LogicalDirection direction) 1325LogicalDirection direction = count < 0 ? LogicalDirection.Backward : LogicalDirection.Forward; 1530public LogicalDirection LogicalDirection 1610TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1614TextSchema.IsFormattingType(position.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1616position.MoveToNextContextPosition(LogicalDirection.Backward); 1617backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1745internal static int GetTextInRun(TextContainer textContainer, int symbolOffset, TextTreeTextNode textNode, int nodeOffset, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 1777skipCount = (direction == LogicalDirection.Forward) ? nodeOffset : textNode.SymbolCount - nodeOffset; 1794textNode = ((direction == LogicalDirection.Forward) ? textNode.GetNextNode() : textNode.GetPreviousNode()) as TextTreeTextNode; 1798if (direction == LogicalDirection.Backward) 1811internal static DependencyObject GetAdjacentElement(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 1967internal bool MoveToNextContextPosition(LogicalDirection direction) 1980if (direction == LogicalDirection.Forward) 2027internal bool MoveToInsertionPosition(LogicalDirection direction) 2070internal bool MoveToNextInsertionPosition(LogicalDirection direction) 2163internal TextElement GetAdjacentElementFromOuterPosition(LogicalDirection direction) 2181internal void SetLogicalDirection(LogicalDirection direction) 2334internal TextPointer GetFrozenPointer(LogicalDirection logicalDirection) 2343void ITextPointer.SetLogicalDirection(LogicalDirection direction) 2383TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 2388int ITextPointer.GetTextRunLength(LogicalDirection direction) 2394string ITextPointer.GetTextInRun(LogicalDirection direction) 2399int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 2404object ITextPointer.GetAdjacentElement(LogicalDirection direction) 2409Type ITextPointer.GetElementType(LogicalDirection direction) 2446ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 2461ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 2472ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 2481ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 2575ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 2580ITextPointer ITextPointer.CreatePointer(int offset, LogicalDirection gravity) 2591ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 2597bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 2654Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 2659bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 2664bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 2674internal bool MoveToCaretPosition(LogicalDirection contentDirection) 2677LogicalDirection oppositeDirection; 2698oppositeDirection = (contentDirection == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 2709internal bool MoveToNextCaretPosition(LogicalDirection direction) 2810internal TextTreeTextNode GetAdjacentTextNodeSibling(LogicalDirection direction) 2817internal static TextTreeTextNode GetAdjacentTextNodeSibling(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 2824internal TextTreeTextElementNode GetAdjacentTextElementNodeSibling(LogicalDirection direction) 2831internal TextTreeTextElementNode GetAdjacentTextElementNode(LogicalDirection direction) 2838internal TextTreeNode GetAdjacentSiblingNode(LogicalDirection direction) 2845internal static TextTreeNode GetAdjacentSiblingNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 2849if (direction == LogicalDirection.Forward) 3005if (GetGravityInternal() == LogicalDirection.Forward) 3436symbolType = node.GetPointerContext(LogicalDirection.Forward); 3443symbolType = firstContainedNode.GetPointerContext(LogicalDirection.Forward); 3461symbolType = nextNode.GetPointerContext(LogicalDirection.Forward); 3493symbolType = previousNode.GetPointerContext(LogicalDirection.Backward); 3513symbolType = lastChildNode.GetPointerContext(LogicalDirection.Backward); 3522symbolType = node.GetPointerContext(LogicalDirection.Backward); 3673LogicalDirection ITextPointer.LogicalDirection 3888private void InitializeOffset(TextPointer position, int distance, LogicalDirection direction) 3925private void Initialize(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection gravity, uint generation, 3985private static void RepositionForGravity(ref TextTreeNode node, ref ElementEdge edge, LogicalDirection gravity) 3996if (gravity == LogicalDirection.Backward) 4009if (gravity == LogicalDirection.Forward) 4022if (gravity == LogicalDirection.Backward) 4035if (gravity == LogicalDirection.Forward) 4053private LogicalDirection GetGravityInternal() 4055return (this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd) ? LogicalDirection.Forward : LogicalDirection.Backward; 4068internal TextTreeNode GetAdjacentNode(LogicalDirection direction) 4073internal static TextTreeNode GetAdjacentNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 4117private TextElement GetElement(LogicalDirection direction) 4136if (GetGravityInternal() == LogicalDirection.Forward)
System\Windows\Documents\TextPointerBase.cs (111)
56internal static string GetTextInRun(ITextPointer position, LogicalDirection direction) 74internal static int GetTextWithLimit(ITextPointer thisPointer, LogicalDirection direction, char[] textBuffer, int startIndex, int count, ITextPointer limit) 83else if (direction == LogicalDirection.Forward && limit.CompareTo(thisPointer) <= 0) 88else if (direction == LogicalDirection.Backward && limit.CompareTo(thisPointer) >= 0) 100if (direction == LogicalDirection.Forward) 182Type forwardType = forwardPosition.GetElementType(LogicalDirection.Forward); 183Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward); 186TextPointerContext forwardContext = forwardPosition.GetPointerContext(LogicalDirection.Forward); 187TextPointerContext backwardContext = backwardPosition.GetPointerContext(LogicalDirection.Backward); 228TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 229TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 252TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 253TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 257typeof(Table).IsAssignableFrom(position.GetElementType(LogicalDirection.Forward))); 270position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 276position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd; 321BorderingElementCategory category = GetBorderingElementCategory(navigator, LogicalDirection.Forward); 328navigator.MoveToNextContextPosition(LogicalDirection.Forward); 330while (GetBorderingElementCategory(navigator, LogicalDirection.Forward) == BorderingElementCategory.MergeableScopingInline); 336elementType = navigator.GetElementType(LogicalDirection.Forward); 340navigator.MoveToNextContextPosition(LogicalDirection.Forward); 357elementType = navigator.GetElementType(LogicalDirection.Forward); 360navigator.MoveToNextInsertionPosition(LogicalDirection.Forward); 373navigator.MoveToNextContextPosition(LogicalDirection.Forward); 375while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 386return IsAtNonMergeableInlineEdge(position, LogicalDirection.Backward); 392return IsAtNonMergeableInlineEdge(position, LogicalDirection.Forward); 402internal static bool IsAtFormatNormalizedPosition(ITextPointer position, LogicalDirection direction) 407internal static bool IsAtInsertionPosition(ITextPointer position, LogicalDirection direction) 412internal static bool IsAtNormalizedPosition(ITextPointer position, LogicalDirection direction, bool respectCaretUnitBoundaries) 421if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 422position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 467internal static bool IsAtWordBoundary(ITextPointer thisPosition, LogicalDirection insideWordDirection) 510return GetWordRange(thisPosition, LogicalDirection.Forward); 522internal static TextSegment GetWordRange(ITextPointer thisPosition, LogicalDirection direction) 545if (moved && IsAtWordBoundary(thisPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 552MoveToNextWordBoundary(navigator, direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 556if (direction == LogicalDirection.Backward) 565wordStart = RestrictWithinBlock(thisPosition, wordStart, LogicalDirection.Backward); 566wordEnd = RestrictWithinBlock(thisPosition, wordEnd, LogicalDirection.Forward); 571wordStart = wordStart.GetFrozenPointer(LogicalDirection.Backward); 572wordEnd = wordEnd.GetFrozenPointer(LogicalDirection.Forward); 576wordStart = wordEnd.GetFrozenPointer(LogicalDirection.Backward); 584private static ITextPointer RestrictWithinBlock(ITextPointer position, ITextPointer limit, LogicalDirection direction) 586Invariant.Assert(!(direction == LogicalDirection.Backward) || position.CompareTo(limit) >= 0, "for backward direction position must be >= than limit"); 587Invariant.Assert(!(direction == LogicalDirection.Forward) || position.CompareTo(limit) <= 0, "for forward direcion position must be <= than linit"); 589while (direction == LogicalDirection.Backward ? position.CompareTo(limit) > 0 : position.CompareTo(limit) < 0) 610return limit.GetInsertionPosition(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 619internal static bool IsNextToPlainLineBreak(ITextPointer thisPosition, LogicalDirection direction) 629(direction == LogicalDirection.Backward && IsCharUnicodeNewLine(textBuffer[1])) 631(direction == LogicalDirection.Forward && IsCharUnicodeNewLine(textBuffer[0])) 647internal static bool IsNextToRichLineBreak(ITextPointer thisPosition, LogicalDirection direction) 656internal static bool IsNextToParagraphBreak(ITextPointer thisPosition, LogicalDirection direction) 667internal static bool IsNextToAnyBreak(ITextPointer thisPosition, LogicalDirection direction) 697bool isAtLineWrappingPosition = position.LogicalDirection == LogicalDirection.Forward 712thisPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 713thisPosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart; 723return thisPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.None && 724thisPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 725!typeof(Inline).IsAssignableFrom(thisPosition.GetElementType(LogicalDirection.Backward)); 739while (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 745pointer = pointer.GetNextContextPosition(LogicalDirection.Backward); 777paragraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 854internal static Rect GetCharacterRect(ITextPointer thisPointer, LogicalDirection direction) 860internal static Rect GetCharacterRect(ITextPointer thisPointer, LogicalDirection direction, bool transformToUiScope) 921internal static bool MoveToFormatNormalizedPosition(ITextPointer thisNavigator, LogicalDirection direction) 934internal static bool MoveToInsertionPosition(ITextPointer thisNavigator, LogicalDirection direction) 957internal static bool MoveToNextInsertionPosition(ITextPointer thisNavigator, LogicalDirection direction) 963int increment = direction == LogicalDirection.Forward ? +1 : -1; 980if ((direction == LogicalDirection.Forward && initialPosition.CompareTo(thisNavigator) < 0) || 981(direction == LogicalDirection.Backward && thisNavigator.CompareTo(initialPosition) < 0)) 1011if (direction == LogicalDirection.Backward) 1024while (TextSchema.IsFormattingType(thisNavigator.GetElementType(LogicalDirection.Forward)) 1035if (direction == LogicalDirection.Forward) 1065internal static bool MoveToNextWordBoundary(ITextPointer thisNavigator, LogicalDirection movingDirection) 1086if (IsAtWordBoundary(thisNavigator, /*insideWordDirection:*/LogicalDirection.Forward)) 1097internal static ITextPointer GetFrozenPointer(ITextPointer thisPointer, LogicalDirection logicalDirection) 1136private static bool NormalizePosition(ITextPointer thisNavigator, LogicalDirection direction, bool respectCaretUnitBoundaries) 1142LogicalDirection oppositeDirection; 1146if (direction == LogicalDirection.Forward) 1149oppositeDirection = LogicalDirection.Backward; 1156oppositeDirection = LogicalDirection.Forward; 1252private static int LeaveNonMergeableInlineBoundary(ITextPointer thisNavigator, LogicalDirection direction, int symbolCount) 1256if (direction == LogicalDirection.Forward && IsAtNonMergeableInlineEnd(thisNavigator)) 1258symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Forward); 1262symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward); 1267if (direction == LogicalDirection.Backward && IsAtNonMergeableInlineStart(thisNavigator)) 1269symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward); 1273symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Forward); 1281private static int LeaveNonMergeableAncestor(ITextPointer thisNavigator, LogicalDirection direction) 1284int increment = (direction == LogicalDirection.Forward) ? +1 : -1; 1329TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 1330TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1365if (position.GetTextInRun(LogicalDirection.Backward, neighborhood, 0, 1) == 1 && 1366position.GetTextInRun(LogicalDirection.Forward, neighborhood, 1, 1) == 1) 1424runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount); 1428navigator.GetTextInRun(LogicalDirection.Forward, preceedingText, SelectionWordBreaker.MinContextLength - preceedingCount, runLength); 1434navigator.MoveToInsertionPosition(LogicalDirection.Backward); 1436while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text); 1443runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Forward), SelectionWordBreaker.MinContextLength - followingCount); 1445navigator.GetTextInRun(LogicalDirection.Forward, followingText, followingCount, runLength); 1454navigator.MoveToInsertionPosition(LogicalDirection.Forward); 1456while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 1467private static bool IsAtNonMergeableInlineEdge(ITextPointer position, LogicalDirection direction) 1487private static BorderingElementCategory GetBorderingElementCategory(ITextPointer position, LogicalDirection direction) 1489TextPointerContext context = (direction == LogicalDirection.Forward) ? TextPointerContext.ElementEnd : TextPointerContext.ElementStart; 1513private static bool IsNextToRichBreak(ITextPointer thisPosition, LogicalDirection direction, Type lineBreakType)
System\Windows\Documents\TextRangeBase.cs (68)
74textPointer = textPointer.GetFormatNormalizedPosition(LogicalDirection.Forward); 78textPointer = textPointer.GetFormatNormalizedPosition(LogicalDirection.Backward); 192normalizedPosition.MoveToInsertionPosition(LogicalDirection.Backward); 207!TextPointerBase.IsAtWordBoundary(thisRange.Start, LogicalDirection.Forward) && // 208!TextPointerBase.IsAtWordBoundary(thisRange.Start, LogicalDirection.Backward)) 283!TextPointerBase.IsNextToAnyBreak(thisRange.End, LogicalDirection.Forward)) 289nextPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 302(TextPointerBase.IsNextToAnyBreak(thisRange.End, LogicalDirection.Backward) || 305ITextPointer newEnd = thisRange.End.GetNextInsertionPosition(LogicalDirection.Backward); 333SkipParagraphContent(start, LogicalDirection.Backward); 334SkipParagraphContent(end, LogicalDirection.Forward); 341private static void SkipParagraphContent(ITextPointer navigator, LogicalDirection direction) 350(nextContext == TextPointerContext.ElementStart && direction == LogicalDirection.Forward || // 351nextContext == TextPointerContext.ElementEnd && direction == LogicalDirection.Backward) && // 355(nextContext == TextPointerContext.ElementEnd && direction == LogicalDirection.Forward || // 356nextContext == TextPointerContext.ElementStart && direction == LogicalDirection.Backward) && // 411if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 413moved = position.MoveToNextContextPosition(LogicalDirection.Forward); 417moved = position.MoveToInsertionPosition(LogicalDirection.Forward); 422moved = position.MoveToNextInsertionPosition(LogicalDirection.Forward); 472position.MoveToNextContextPosition(LogicalDirection.Backward)) ; 493moved = position.MoveToNextContextPosition(LogicalDirection.Forward); 516endNavigator.MoveToInsertionPosition(LogicalDirection.Backward); 678TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 694navigator.MoveToNextContextPosition(LogicalDirection.Forward); 704navigator.MoveToNextContextPosition(LogicalDirection.Forward); 709navigator.MoveToNextContextPosition(LogicalDirection.Forward); 712elementType = navigator.GetElementType(LogicalDirection.Forward); 732navigator.MoveToNextContextPosition(LogicalDirection.Forward); 748int runLength = navigator.GetTextRunLength(LogicalDirection.Forward); 750runLength = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, charArray, 0, runLength, endPosition); 752navigator.MoveToNextContextPosition(LogicalDirection.Forward); 762bool theParagraphIsTheFirstInCollection = navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 763navigator.MoveToNextContextPosition(LogicalDirection.Forward); 765TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 772navigator.MoveToNextContextPosition(LogicalDirection.Forward); 773symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 796List list = (List)navigator.GetAdjacentElement(LogicalDirection.Forward); 817navigator.MoveToNextContextPosition(LogicalDirection.Forward); 827ListItem listItem = (ListItem)navigator.GetAdjacentElement(LogicalDirection.Forward); 859object element = navigator.GetAdjacentElement(LogicalDirection.Forward); 1251while (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1255start = start.GetNextContextPosition(LogicalDirection.Backward); 1311if (thisRange.Start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 1312thisRange.End.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 1358(insertPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.None || 1359insertPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) && 1360(insertPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.None || 1361insertPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd); 1372ITextPointer newStart = insertPosition.GetFrozenPointer(LogicalDirection.Backward); 1373ITextPointer newEnd = insertPosition.CreatePointer(LogicalDirection.Forward); 1378TextPointer insertionPosition = (TextPointer)newStart.CreatePointer(LogicalDirection.Forward); 1416newEnd = newEnd.GetNextInsertionPosition(LogicalDirection.Forward); 1617TextPointerContext context = start.GetPointerContext(LogicalDirection.Forward); 1620start.MoveToNextContextPosition(LogicalDirection.Forward); 1621context = start.GetPointerContext(LogicalDirection.Forward); 1626context = end.GetPointerContext(LogicalDirection.Backward); 1629end.MoveToNextContextPosition(LogicalDirection.Backward); 1630context = end.GetPointerContext(LogicalDirection.Backward); 1634return start.GetAdjacentElement(LogicalDirection.Forward) as UIElement; 1715start = GetNormalizedPosition(thisRange, start, LogicalDirection.Forward); 1722end = GetNormalizedPosition(thisRange, end, LogicalDirection.Backward); 1729if (start.LogicalDirection == LogicalDirection.Backward) 1732start = end.GetFrozenPointer(LogicalDirection.Backward); 1783private static bool IsAtNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction) 1799private static ITextPointer GetNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction) 1957!TextPointerBase.IsAtInsertionPosition(start, LogicalDirection.Forward) || 1958!TextPointerBase.IsAtInsertionPosition(end, LogicalDirection.Backward))
System\Windows\Documents\TextRangeEdit.cs (76)
66if (!keepEmptyFormatting && splitPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 72else if (!keepEmptyFormatting && splitPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 263while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 268while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 278position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 279position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 280(firstInline = position.GetAdjacentElement(LogicalDirection.Backward) as Inline) != null && 281(secondInline = position.GetAdjacentElement(LogicalDirection.Forward) as Inline) != null) 330inline.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 331inline.ElementEnd.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 417if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 458start = start.GetNextContextPosition(LogicalDirection.Forward); 532if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 539else if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 555Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd, "position must be after ElementEnd"); 556Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "position must be before ElementStart"); 656while (!(breakPosition.Parent is Paragraph) && breakPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 658breakPosition = breakPosition.GetNextContextPosition(LogicalDirection.Forward); 662breakPosition = breakPosition.GetInsertionPosition(LogicalDirection.Forward); 699return lineBreak.ElementEnd.GetInsertionPosition(LogicalDirection.Forward); 798start = block.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 805TextPointer contentStart = block.ContentStart.GetPositionAtOffset(0, LogicalDirection.Forward); // Normalize forward; 806contentStart = contentStart.GetNextContextPosition(LogicalDirection.Forward); // Leave scope of initial List. 826start = block.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 967TextPointer start = firstChild.ElementStart.GetFrozenPointer(LogicalDirection.Backward); 968TextPointer end = lastChild.ElementEnd.GetFrozenPointer(LogicalDirection.Forward); 975firstChild = (Inline)start.GetAdjacentElement(LogicalDirection.Forward); 976lastChild = (Inline)end.GetAdjacentElement(LogicalDirection.Backward); 1031if (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 1049pointer = pointer.GetNextContextPosition(LogicalDirection.Forward); 1248if (rangeStart.CompareTo(rangeEnd) < 0 && rangeEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 1250rangeEnd = rangeEnd.GetNextInsertionPosition(LogicalDirection.Backward); 1258rangeEnd = rangeEnd.GetInsertionPosition(LogicalDirection.Backward); 1267TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1268TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 1278while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1283while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 1298while (previousPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 1299TextSchema.IsMergeableInline(previousPosition.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1301previousPosition = ((Inline)previousPosition.GetAdjacentElement(LogicalDirection.Backward)).ContentEnd; 1307while (nextPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 1308TextSchema.IsMergeableInline(nextPosition.GetAdjacentElement(LogicalDirection.Forward).GetType())) 1310nextPosition = ((Inline)nextPosition.GetAdjacentElement(LogicalDirection.Forward)).ContentStart; 1439while (startPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1440startPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 1578LogicalDirection direction; 1579LogicalDirection oppositeDirection; 1586direction = LogicalDirection.Forward; 1587oppositeDirection = LogicalDirection.Backward; 1595direction = LogicalDirection.Backward; 1596oppositeDirection = LogicalDirection.Forward; 1613Invariant.Assert(direction == LogicalDirection.Forward && nextPosition.CompareTo(end) < 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) > 0, 1625if (direction == LogicalDirection.Forward && nextPosition.CompareTo(end) > 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) < 0) 1639if (direction == LogicalDirection.Forward && nextPosition.CompareTo(end) >= 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) <= 0) 1893TextPointer nextRunPosition = run.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 1901nextRunPosition = nextRunPosition.GetNextContextPosition(LogicalDirection.Forward); 2053Span parent = (Span)end.GetAdjacentElement(LogicalDirection.Backward); 2083if (pointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 2084(run = pointer.GetAdjacentElement(LogicalDirection.Forward) as Run) != null) 2098pointer = pointer.GetNextContextPosition(LogicalDirection.Forward); 2110start = start.GetPositionAtOffset(0, LogicalDirection.Forward); 2114start = start.GetNextContextPosition(LogicalDirection.Forward); 2118if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2128start = start.GetNextContextPosition(LogicalDirection.Forward); 2149run = (Run)start.GetAdjacentElement(LogicalDirection.Forward); 2162DependencyObject forwardElement = start.GetAdjacentElement(LogicalDirection.Forward); 2163DependencyObject backwardElement = end.GetAdjacentElement(LogicalDirection.Backward); 2168Inline inline = (Inline)start.GetAdjacentElement(LogicalDirection.Forward); 2187start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2188end.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 2189start.GetAdjacentElement(LogicalDirection.Backward) == commonAncestor) 2234if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2246start = start.GetNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\TextRangeEditLists.cs (27)
76while (secondParagraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 95TextPointer positionAfterSecondParagraph = secondParagraphOrBlockUIContainer.ElementEnd.GetFrozenPointer(LogicalDirection.Forward); 100TextElement previousBlock = secondParagraphOrBlockUIContainer.ElementStart.GetAdjacentElement(LogicalDirection.Backward) as TextElement; 144ListItem followingListItem = positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart 145? positionAfterSecondParagraph.GetAdjacentElement(LogicalDirection.Forward) as ListItem : null; 148ListItem precedingListItem = positionAfterSecondParagraph.GetAdjacentElement(LogicalDirection.Backward) as ListItem; 152Invariant.Assert(positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 153Invariant.Assert(positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd); 174while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 176navigator.MoveToNextContextPosition(LogicalDirection.Forward); 186while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 188navigator.MoveToNextContextPosition(LogicalDirection.Backward); 209if (mergePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementEnd || 210mergePosition.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementStart) 215List precedingList = mergePosition.GetAdjacentElement(LogicalDirection.Backward) as List; 216List followingList = mergePosition.GetAdjacentElement(LogicalDirection.Forward) as List; 308Block nextBlock = block == lastBlock ? null : block.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as Block; 374ListItem nextListItem = listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as ListItem; 560ListItem nextListItem = listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as ListItem; 607while (end.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 613end = end.GetNextContextPosition(LogicalDirection.Forward); 636while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 643position = position.GetNextContextPosition(LogicalDirection.Forward); 647while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 656position = position.GetNextContextPosition(LogicalDirection.Forward); 764TextPointer adjustedEnd = list.ElementEnd.GetInsertionPosition(LogicalDirection.Backward); 767adjustedEnd = adjustedEnd.GetNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Documents\TextRangeEditTables.cs (35)
67TextPointer lastCellPointer = (TextPointer)range.TextSegments[0].End.GetNextInsertionPosition(LogicalDirection.Backward); 428internal static TextPointer GetNextTableCellRangeInsertionPosition(TextSelection selection, LogicalDirection direction) 449if (direction == LogicalDirection.Backward && movingCell == anchorCell) 454else if (direction == LogicalDirection.Forward && 467if (direction == LogicalDirection.Forward) 528movingPosition = movingCell.ContentEnd.GetInsertionPosition().GetNextInsertionPosition(LogicalDirection.Forward); 538if (direction == LogicalDirection.Forward) 558internal static TextPointer GetNextRowEndMovingPosition(TextSelection selection, LogicalDirection direction) 567return (direction == LogicalDirection.Forward) ? row.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward) : 568row.ContentStart.GetNextInsertionPosition(LogicalDirection.Backward); 587internal static TextPointer GetNextRowStartMovingPosition(TextSelection selection, LogicalDirection direction) 599return (direction == LogicalDirection.Forward) ? row.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward) : 600row.ContentStart.GetNextInsertionPosition(LogicalDirection.Backward); 750bool insertBefore = position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 788nextInsertionPosition = nextInsertionPosition.GetNextInsertionPosition(LogicalDirection.Forward); 813while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 815position = position.GetNextContextPosition(LogicalDirection.Forward); 817while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd) 819position = position.GetNextContextPosition(LogicalDirection.Backward); 894if (position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is Run) 897insertionPosition.MoveToNextContextPosition(LogicalDirection.Forward); 900else if (position.GetAdjacentElementFromOuterPosition(LogicalDirection.Backward) is Run) 903insertionPosition.MoveToNextContextPosition(LogicalDirection.Backward); 1079TextPointer end = ((TextPointer)textSegment.End).GetNextInsertionPosition(LogicalDirection.Backward); 1087cellEnd.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1089cell = (TableCell)cellEnd.GetAdjacentElement(LogicalDirection.Forward); 1964startPosition = startPosition.GetInsertionPosition(LogicalDirection.Forward); 1967endPosition = endPosition.GetInsertionPosition(LogicalDirection.Backward); 1992TextPointer start = startCell.ContentStart.GetInsertionPosition(LogicalDirection.Forward); 1996TextPointer end = endCell.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward); 2053anchorPosition = anchorPosition.GetInsertionPosition(LogicalDirection.Forward); 2056movingPosition = movingPosition.GetInsertionPosition(LogicalDirection.Backward); 2094movingPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
System\Windows\Documents\TextRangeSerialization.cs (54)
76range.End.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart; 205while (rangeEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 207rangeEnd = rangeEnd.GetNextContextPosition(LogicalDirection.Backward); 213TextPointerContext runType = textReader.GetPointerContext(LogicalDirection.Forward); 218TextElement nextElement = (TextElement)textReader.GetAdjacentElement(LogicalDirection.Forward); 227textReader.MoveToNextContextPosition(LogicalDirection.Forward); 247textReader.MoveToNextContextPosition(LogicalDirection.Forward); 255textReader.MoveToNextContextPosition(LogicalDirection.Forward); 265if (ignoreWriteHyperlinkEnd && (textReader.GetAdjacentElement(LogicalDirection.Forward) is Hyperlink)) 269textReader.MoveToNextContextPosition(LogicalDirection.Forward); 282textReader.MoveToNextContextPosition(LogicalDirection.Forward); 299textReader.MoveToNextContextPosition(LogicalDirection.Forward); 303int textLength = textReader.GetTextRunLength(LogicalDirection.Forward); 306textLength = TextPointerBase.GetTextWithLimit(textReader, LogicalDirection.Forward, text, 0, textLength, rangeEnd); 313textReader.MoveToNextContextPosition(LogicalDirection.Forward); 317object embeddedObject = textReader.GetAdjacentElement(LogicalDirection.Forward); 318textReader.MoveToNextContextPosition(LogicalDirection.Forward); 325textReader.MoveToNextContextPosition(LogicalDirection.Forward); 546InlineUIContainer inlineUIContainer = textReader.GetAdjacentElement(LogicalDirection.Backward) as InlineUIContainer; 547BlockUIContainer blockUIContainer = textReader.GetAdjacentElement(LogicalDirection.Backward) as BlockUIContainer; 1226TextElement uiContainer = fragment.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 1332fragmentEnd = fragment.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); // need forward orientation to stick with the following content during merge at fragmentStart position 1360fragmentEnd = fragmentEnd.GetInsertionPosition(LogicalDirection.Forward); 1414while (positionBeforeParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1417positionBeforeParagraph = positionBeforeParagraph.GetNextContextPosition(LogicalDirection.Backward); 1419while (positionBeforeParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1423positionBeforeParagraph = positionBeforeParagraph.GetNextContextPosition(LogicalDirection.Backward); 1457if (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd) 1459navigator = navigator.GetNextContextPosition(LogicalDirection.Backward); 1475if (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1477navigator = navigator.GetNextContextPosition(LogicalDirection.Forward); 1512TextPointerContext forwardFromStart = start.GetPointerContext(LogicalDirection.Forward); 1513TextPointerContext backwardFromEnd = end.GetPointerContext(LogicalDirection.Backward); 1516Invariant.Assert(itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1518Invariant.Assert(itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1522TextPointerContext backwardFromStart = start.GetPointerContext(LogicalDirection.Backward); 1523TextPointerContext forwardFromEnd = end.GetPointerContext(LogicalDirection.Forward); 1525Invariant.Assert(!(backwardFromStart == TextPointerContext.ElementEnd) || itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1528Invariant.Assert(!(forwardFromEnd == TextPointerContext.ElementStart) || itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1550((Section)fragment).HasTrailingParagraphBreakOnPaste = range.End.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None; 1606start = start.GetNextContextPosition(LogicalDirection.Forward); 1610TextPointerContext passedContext = start.GetPointerContext(LogicalDirection.Backward); 1650start = start.GetNextContextPosition(LogicalDirection.Forward); 1657start = start.GetNextContextPosition(LogicalDirection.Forward); 1847Invariant.Assert(textReader.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 1852elementEnd.MoveToNextContextPosition(LogicalDirection.Forward); 1874Invariant.Assert(textReader.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 1875Invariant.Assert(typeof(Hyperlink).IsAssignableFrom(textReader.GetElementType(LogicalDirection.Forward))); 1880Hyperlink hyperlink = (Hyperlink)textReader.GetAdjacentElement(LogicalDirection.Forward); 1885hyperlinkEnd.MoveToNextContextPosition(LogicalDirection.Forward); 1900InlineUIContainer inlineUIContainer = hyperlinkNavigation.GetAdjacentElement(LogicalDirection.Forward) as InlineUIContainer; 1907hyperlinkNavigation.MoveToNextContextPosition(LogicalDirection.Forward); 1922hyperlinkStart = range.Start.CreatePointer(LogicalDirection.Forward); 1923while (hyperlinkStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
System\Windows\Documents\TextSchema.cs (5)
162TextElement leftElement = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Backward); 163TextElement rightElement = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 888TextPointerContext forwardContext = start.GetPointerContext(LogicalDirection.Forward); 891TextElement nextElement = (TextElement)start.GetAdjacentElement(LogicalDirection.Forward); 904start = start.GetNextContextPosition(LogicalDirection.Forward);
System\windows\Documents\TextSegment.cs (2)
75_start = startPosition.GetFrozenPointer(preserveLogicalDirection ? startPosition.LogicalDirection : LogicalDirection.Backward); 76_end = endPosition.GetFrozenPointer(preserveLogicalDirection ? endPosition.LogicalDirection : LogicalDirection.Forward);
System\windows\Documents\TextSelection.cs (64)
300((ITextSelection)this).SetCaretToPosition(((ITextRange)this).End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 451void ITextSelection.SetCaretToPosition(ITextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace) 466ITextPointer reversePosition = caretPosition.CreatePointer(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward); 472TextPointerBase.IsNextToPlainLineBreak(caretPosition, LogicalDirection.Backward) || 473TextSchema.IsBreak(caretPosition.GetElementType(LogicalDirection.Backward)))) 477caretPosition.SetLogicalDirection(LogicalDirection.Forward); 481if (caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 482caretPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 504LogicalDirection oppositeDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 581bool ITextSelection.ExtendToNextInsertionPosition(LogicalDirection direction) 616if (newMovingPosition == null && direction == LogicalDirection.Forward) 636LogicalDirection contentDirection = (anchorPosition.CompareTo(newMovingPosition) <= 0) ? 637LogicalDirection.Backward : LogicalDirection.Forward; 653private ITextPointer GetNextTextSegmentInsertionPosition(LogicalDirection direction) 840startPosition = anchorWordRange.Start.GetFrozenPointer(LogicalDirection.Forward); 841movingPosition = cursorWordRange.End.GetFrozenPointer(LogicalDirection.Backward); 845startPosition = anchorWordRange.End.GetFrozenPointer(LogicalDirection.Backward); 846movingPosition = cursorWordRange.Start.GetFrozenPointer(LogicalDirection.Forward); 962anchorWordRange.Contains(cursorPosition.GetInsertionPosition(LogicalDirection.Forward)) || 963anchorWordRange.Contains(cursorPosition.GetInsertionPosition(LogicalDirection.Backward))) 975TextPointerBase.IsAtWordBoundary(anchorPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 989TextPointerBase.IsAtWordBoundary(cursorPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 1024bool ITextSelection.ExtendToNextTableRow(LogicalDirection direction) 1052if (direction == LogicalDirection.Forward) 1081movingPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 1181internal void SetCaretToPosition(TextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace) 1189internal bool ExtendToNextInsertionPosition(LogicalDirection direction) 1386this.SetCaretToPosition(cellStart, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1550Invariant.Assert(this.Start.LogicalDirection == LogicalDirection.Backward); 1551Invariant.Assert(this.End.LogicalDirection == LogicalDirection.Forward); 1756return (This.Start.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 1757This.End.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text && 1758This.Start.GetNextInsertionPosition(LogicalDirection.Backward) == null && 1759This.End.GetNextInsertionPosition(LogicalDirection.Forward) == null); 1994(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X < cursorMousePoint.X || 1995cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X < objectEdgeRect.X)) 2000(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X > cursorMousePoint.X || 2001cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X > objectEdgeRect.X)) 2009(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X > cursorMousePoint.X || 2010cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X > objectEdgeRect.X)) 2015(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X < cursorMousePoint.X || 2016cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X < objectEdgeRect.X)) 2178if ((caretPosition.LogicalDirection == LogicalDirection.Backward && // 2179caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) || // 2186caretPosition.MoveToNextInsertionPosition(LogicalDirection.Backward); 2187caretPosition.SetLogicalDirection(LogicalDirection.Forward); 2195if (caretPosition.LogicalDirection == LogicalDirection.Backward && // 2196caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && // 2197(caretPosition.GetNextInsertionPosition(LogicalDirection.Backward) == null || // 2198TextPointerBase.IsNextToAnyBreak(caretPosition, LogicalDirection.Backward))) 2201caretPosition.SetLogicalDirection(LogicalDirection.Forward); 2275nextCharacterPosition = focusedTextSelection.Start.CreatePointer(LogicalDirection.Forward); 2280nextCharacterPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 2281nextCharacterPosition.SetLogicalDirection(LogicalDirection.Backward); 2289nextCharacterPosition = focusedTextSelection.End.CreatePointer(LogicalDirection.Backward); 2294nextCharacterPosition.MoveToNextInsertionPosition(LogicalDirection.Backward); 2295nextCharacterPosition.SetLogicalDirection(LogicalDirection.Forward); 2757private LogicalDirection _movingPositionDirection;
System\windows\Documents\TextSelectionHighlightLayer.cs (6)
55internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 72internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 90if ((direction == LogicalDirection.Forward && textSegment.Start.CompareTo(textPosition) <= 0 && textPosition.CompareTo(textSegment.End) < 0) || // 91(direction == LogicalDirection.Backward && textSegment.Start.CompareTo(textPosition) < 0 && textPosition.CompareTo(textSegment.End) <= 0)) 101internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 115if (direction == LogicalDirection.Forward)
System\Windows\Documents\TextServicesPropertyRanges.cs (2)
129start = _textstore.CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 130end = _textstore.CreatePointerAtCharOffset(startIndex + length, LogicalDirection.Forward);
System\Windows\Documents\TextStore.cs (73)
367this.TextSelection.SetCaretToPosition(start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 407navigator = CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 408limit = (endIndex >= 0) ? CreatePointerAtCharOffset(endIndex, LogicalDirection.Forward) : null; 415TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Forward); 429TextElement element = (TextElement)((TextPointer)navigator).GetAdjacentElement(LogicalDirection.Forward); 438navigator.MoveToNextContextPosition(LogicalDirection.Forward); 444navigator.MoveToNextContextPosition(LogicalDirection.Forward); 491start = start.GetNextInsertionPosition(LogicalDirection.Forward); 685startNavigator.SetLogicalDirection(LogicalDirection.Backward); 687endNavigator.SetLogicalDirection(LogicalDirection.Forward); 865position = CreatePointerAtCharOffset(index, LogicalDirection.Forward); 981ITextPointer positionCur = position.CreatePointer(LogicalDirection.Backward); 982ITextPointer positionPrev = position.CreatePointer(LogicalDirection.Forward); 983positionPrev.MoveToNextInsertionPosition(LogicalDirection.Backward); 1050startPointer = CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 1051startPointer.MoveToInsertionPosition(LogicalDirection.Forward); 1061Rect rectStart = startPointer.GetCharacterRect(LogicalDirection.Forward); 1069endPointer = CreatePointerAtCharOffset(endIndex, LogicalDirection.Backward); 1070endPointer.MoveToInsertionPosition(LogicalDirection.Backward); 1091lineRect = navigator.GetCharacterRect(LogicalDirection.Forward); 1092moved = navigator.MoveToNextInsertionPosition(LogicalDirection.Forward); 1486navigator.MoveToInsertionPosition(LogicalDirection.Forward); 1491if (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 1497navigator.GetTextInRun(LogicalDirection.Forward, nextChars, 0, nextChars.Length); 1503TextSelection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 1902internal ITextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 2011this.TextSelection.SetCaretToPosition(range.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 2385_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward); 2386_previousCompositionEnd = (_previousCompositionEndOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionEndOffset, LogicalDirection.Forward); 2404_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward); 2405_previousCompositionEnd = (_previousCompositionEndOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionEndOffset, LogicalDirection.Forward); 2452Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 2459runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2468runCount = navigator.GetTextRunLength(LogicalDirection.Forward); 2469navigator.MoveToNextContextPosition(LogicalDirection.Forward); 2511Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement); 2521navigator.MoveToNextContextPosition(LogicalDirection.Forward); 2553Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart || navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd); 2571char ch = (navigator.GetAdjacentElement(LogicalDirection.Forward) is TableCell) ? UnsafeNativeMethods.TS_CHAR_REGION : '\n'; 2904start = CreatePointerAtCharOffset(startIndex, LogicalDirection.Backward); 2905end = CreatePointerAtCharOffset(startIndex + length, LogicalDirection.Forward); 2907while (start.CompareTo(end) < 0 && start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 2909start.MoveToNextContextPosition(LogicalDirection.Forward); 3032positionNext.MoveToNextInsertionPosition(LogicalDirection.Forward); 3036positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward); 3175Rect lineBounds = start.GetCharacterRect(LogicalDirection.Forward); 3176lineBounds.Union(end.GetCharacterRect(LogicalDirection.Backward)); 3179ITextPointer navigator = start.CreatePointer(LogicalDirection.Forward); 3180while (navigator.MoveToNextContextPosition(LogicalDirection.Forward) == true && navigator.CompareTo(end) < 0) 3182TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Backward); 3186lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward)); 3191lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward)); 3409TextPointer previousPosition = start.GetNextInsertionPosition(LogicalDirection.Backward); 3422if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 3424start = start.GetNextInsertionPosition(LogicalDirection.Backward); 3428start = start.GetNextInsertionPosition(LogicalDirection.Forward); 3436start = start.GetNextInsertionPosition(LogicalDirection.Forward); 3456start = CreatePointerAtCharOffset(startCharOffset, LogicalDirection.Forward); 3457end = (startCharOffset == endCharOffset) ? start : CreatePointerAtCharOffset(endCharOffset, LogicalDirection.Backward); 3462TextPointerContext forwardContext = start.GetPointerContext(LogicalDirection.Forward); 3466TextElement element = start.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 3478start.MoveToNextContextPosition(LogicalDirection.Forward); 3489start = start.GetFormatNormalizedPosition(LogicalDirection.Backward); 3494start = start.GetFormatNormalizedPosition(LogicalDirection.Backward); 3495end = end.GetFormatNormalizedPosition(LogicalDirection.Backward); 3637ITextPointer start = this.TextContainer.CreatePointerAtOffset(record.StartOffsetBefore, LogicalDirection.Backward); 3638ITextPointer end = this.TextContainer.CreatePointerAtOffset(record.EndOffsetBefore, LogicalDirection.Forward); 3799start = end.GetFrozenPointer(LogicalDirection.Backward); 3956ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(appSelectionAnchorOffset, LogicalDirection.Forward); 3957ITextPointer moving = this.TextContainer.CreatePointerAtOffset(appSelectionMovingOffset, LogicalDirection.Forward); 3977ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(imeSelectionAnchorOffset, LogicalDirection.Backward); 3978ITextPointer moving = this.TextContainer.CreatePointerAtOffset(imeSelectionMovingOffset, LogicalDirection.Backward);
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (6)
40node = start.GetAdjacentNode(LogicalDirection.Forward); 41haltNode = end.GetAdjacentNode(LogicalDirection.Forward); 74navigator = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 426navigator.MoveToNextContextPosition(LogicalDirection.Backward); 442navigator.MoveToNextContextPosition(LogicalDirection.Forward); 474TextPointer textPointerTable = new TextPointer(navigator.TextContainer.Start, _cpTable, LogicalDirection.Forward);
System\Windows\Documents\TextTreeExtractElementUndoUnit.cs (3)
59start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 60end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount - 2, LogicalDirection.Forward); 70end.MoveToNextContextPosition(LogicalDirection.Backward);
System\Windows\Documents\TextTreeFixupNode.cs (1)
107internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreeInsertElementUndoUnit.cs (3)
54start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 56Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree."); 58element = start.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
System\Windows\Documents\TextTreeInsertUndoUnit.cs (2)
54start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 55end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount, LogicalDirection.Forward);
System\Windows\Documents\TextTreeNode.cs (4)
367internal abstract TextPointerContext GetPointerContext(LogicalDirection direction); 471return GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 474internal ElementEdge GetEdgeFromOffset(int nodeOffset, LogicalDirection bias) 483edge = (bias == LogicalDirection.Forward) ? ElementEdge.AfterEnd : ElementEdge.BeforeStart;
System\Windows\Documents\TextTreeObjectNode.cs (1)
72internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreePropertyUndoUnit.cs (2)
50position = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 52Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree.");
System\Windows\Documents\TextTreeRootNode.cs (1)
84internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreeTextElementNode.cs (2)
80internal override TextPointerContext GetPointerContext(LogicalDirection direction) 82return (direction == LogicalDirection.Forward) ? TextPointerContext.ElementStart : TextPointerContext.ElementEnd;
System\Windows\Documents\TextTreeTextNode.cs (1)
99internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\ValidationHelper.cs (4)
69internal static void VerifyDirection(LogicalDirection direction, string argumentName) 71if (direction != LogicalDirection.Forward && 72direction != LogicalDirection.Backward) 74throw new InvalidEnumArgumentException(argumentName, (int)direction, typeof(LogicalDirection));
System.Windows.Controls.Ribbon (7)
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
867strValue += textElement.ContentStart.GetTextInRun(LogicalDirection.Forward);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (6)
301string firstLineText = secondLinePointer.GetTextInRun(LogicalDirection.Backward); 302string secondLineText = secondLinePointer.GetTextInRun(LogicalDirection.Forward); 410lastCharacter = nextLinePointer.GetCharacterRect(LogicalDirection.Backward); 411firstCharacter = currentLinePointer.GetCharacterRect(LogicalDirection.Forward); 418lastCharacter = _textBlock1.ContentEnd.GetCharacterRect(LogicalDirection.Backward); 419firstCharacter = currentLinePointer.GetCharacterRect(LogicalDirection.Forward);