1898 references to LogicalDirection
PresentationFramework (1891)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (6)
95ITextPointer startPointer = segment.Start.CreatePointer(LogicalDirection.Forward); 102ITextPointer endPointer = segment.End.CreatePointer(LogicalDirection.Backward); 543if (!start.IsAtInsertionPosition && !start.MoveToNextInsertionPosition(LogicalDirection.Forward)) 567if (!end.IsAtInsertionPosition && !end.MoveToNextInsertionPosition(LogicalDirection.Backward)) 601start = textView.TextSegments[0].Start.CreatePointer(LogicalDirection.Forward); 602end = textView.TextSegments[textView.TextSegments.Count - 1].End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Anchoring\TextSelectionHelper.cs (5)
134current.MoveToNextContextPosition(LogicalDirection.Forward); 189IDocumentPaginatorSource content = GetPointerPage(pointer.CreatePointer(LogicalDirection.Forward), out pageNumber); 230return GetAnchorPointForPointer(anchor.Start.CreatePointer(LogicalDirection.Forward)); 422ITextPointer start = segment.Start.CreatePointer(LogicalDirection.Forward); 423ITextPointer end = segment.End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (20)
236internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 245((highlightSegment.Segment.Start.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward))) 252((highlightSegment.Segment.End.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward))) 263internal override bool IsContentHighlighted(StaticTextPointer staticTextPosition, LogicalDirection direction) 270internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 274if (direction == LogicalDirection.Forward) 759internal IList<HighlightSegment> Split(ITextPointer ps, LogicalDirection side) 764if (((ps.CompareTo(_segment.Start) == 0) && (side == LogicalDirection.Forward)) || 765((ps.CompareTo(_segment.End) == 0) && (side == LogicalDirection.Backward))) 822IList<HighlightSegment> r1 = Split(ps1, LogicalDirection.Forward); 827IList<HighlightSegment> r2 = r1[i].Split(ps2, LogicalDirection.Backward); 844res = Split(ps2, LogicalDirection.Backward); 987TextPointerContext nextContext = cursor.GetPointerContext(LogicalDirection.Forward); 990Type elementType = cursor.GetElementType(LogicalDirection.Forward); 1004cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1024cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1032cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1052segmentStart = cursor.GetInsertionPosition(LogicalDirection.Forward); 1069ITextPointer segmentEnd = cursor.GetInsertionPosition(LogicalDirection.Backward); 1099ITextView parentView = TextSelectionHelper.GetDocumentPageTextView(TopOwner.Range.Start.CreatePointer(LogicalDirection.Forward));
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (8)
658ITextPointer start = anchor.Start.CreatePointer(LogicalDirection.Forward); 659ITextPointer end = anchor.End.CreatePointer(LogicalDirection.Backward); 796LogicalDirection direction = pointer.LogicalDirection; 824nextPointer = nextPointer.CreatePointer(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 830if (direction == LogicalDirection.Forward) 855if (direction == LogicalDirection.Backward)
MS\Internal\Annotations\TextAnchor.cs (8)
113textPointer = textPointer.GetInsertionPosition(LogicalDirection.Forward); 117textPointer = textPointer.GetInsertionPosition(LogicalDirection.Backward); 215(theirSegment.Start.LogicalDirection == LogicalDirection.Forward)) 221(theirSegment.End.LogicalDirection == LogicalDirection.Backward)) 666start = start.GetInsertionPosition(LogicalDirection.Forward); 670end = end.GetInsertionPosition(LogicalDirection.Backward); 677if (start.LogicalDirection == LogicalDirection.Backward) 680start = end.GetFrozenPointer(LogicalDirection.Backward);
MS\Internal\Documents\DocumentGrid.cs (1)
298tp = tp.CreatePointer(LogicalDirection.Forward);
MS\Internal\Documents\DocumentPageTextView.cs (1)
255internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\DocumentViewerHelper.cs (1)
401contextMenuPosition = textContainer.TextSelection.Start.CreatePointer(LogicalDirection.Forward);
MS\Internal\Documents\HostedElements.cs (9)
91_currentPosition.MoveToNextContextPosition(LogicalDirection.Forward); 100if (_currentPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart || 101_currentPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement) 107_currentPosition.MoveToNextContextPosition(LogicalDirection.Forward); 172switch (_currentPosition.GetPointerContext(LogicalDirection.Forward)) 175Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 176currentElement = _currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 179Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement); 180currentElement = (IInputElement)_currentPosition.GetAdjacentElement(LogicalDirection.Forward);
MS\Internal\Documents\LineResult.cs (1)
41internal abstract ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction);
MS\Internal\Documents\MultiPageTextView.cs (1)
235internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\ParagraphResult.cs (1)
381internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\TableTextElementCollectionInternal.cs (2)
152TextPointer startPosition = new TextPointer(item.TextContainer, item.TextElementNode, ElementEdge.BeforeStart, LogicalDirection.Backward); 153TextPointer endPosition = new TextPointer(item.TextContainer, item.TextElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
MS\Internal\Documents\TextBoxLine.cs (8)
73switch (position.GetPointerContext(LogicalDirection.Forward)) 111ITextPointer position = _owner.Host.TextContainer.CreatePointerAtOffset(dcp, LogicalDirection.Backward); 116int runLength = Math.Min(128, position.GetTextRunLength(LogicalDirection.Backward)); 118position.GetTextInRun(LogicalDirection.Backward, text, 0, runLength); 423StaticTextPointer endOfRunPosition = _owner.Host.TextContainer.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 435TextDecorationCollection highlightDecorations = highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection; 453&& highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(TextSelection)) != DependencyProperty.UnsetValue) 482int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length);
MS\Internal\Documents\TextBoxView.cs (53)
588if (offset > 0 && position.LogicalDirection == LogicalDirection.Backward) 612if (position.LogicalDirection == LogicalDirection.Forward || position.Offset == 0) 619if (position.LogicalDirection == LogicalDirection.Backward && position.Offset > 0) 660firstLineIndex = Math.Max(firstLineIndex, GetLineIndexFromOffset(startOffset, LogicalDirection.Forward)); 661lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward)); 700ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].EndOffset, LogicalDirection.Backward); 701if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 740nextLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex + linesMoved].Offset, LogicalDirection.Forward); 779if (position.LogicalDirection == LogicalDirection.Forward) 784else if (position.LogicalDirection == LogicalDirection.Backward) 809ITextPointer ITextView.GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 815if (position.Offset == 0 && direction == LogicalDirection.Backward) 817return position.GetFrozenPointer(LogicalDirection.Forward); 819else if (position.Offset == _host.TextContainer.SymbolCount && direction == LogicalDirection.Forward) 821return position.GetFrozenPointer(LogicalDirection.Backward); 831if (direction == LogicalDirection.Forward) 844LogicalDirection logicalDirection; 846direction == LogicalDirection.Forward) 852logicalDirection = LogicalDirection.Backward; 856logicalDirection = LogicalDirection.Forward; 860direction == LogicalDirection.Backward) 866logicalDirection = LogicalDirection.Forward; 870logicalDirection = LogicalDirection.Backward; 875logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 894return position.GetFrozenPointer(LogicalDirection.Forward); 897int lineIndex = GetLineIndexFromPosition(position, LogicalDirection.Backward); 907LogicalDirection logicalDirection; 914logicalDirection = LogicalDirection.Forward; 918logicalDirection = LogicalDirection.Backward; 923logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 941ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].Offset, LogicalDirection.Forward); 942ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].Offset + _lineMetrics[lineIndex].ContentLength, LogicalDirection.Forward); 1264ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[0].Offset, LogicalDirection.Backward); 1265ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[_lineMetrics.Count - 1].EndOffset, LogicalDirection.Forward); 1659private int GetLineIndexFromPosition(ITextPointer position, LogicalDirection direction) 1665private int GetLineIndexFromOffset(int offset, LogicalDirection direction) 1667if (offset > 0 && direction == LogicalDirection.Backward) 1713LogicalDirection logicalDirection; 1719logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 1894int firstLineIndex = GetLineIndexFromOffset(range.StartIndex, LogicalDirection.Forward); 1896int lastLineIndex = GetLineIndexFromOffset(endOffset, LogicalDirection.Backward); 2016ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward); 2017if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward)) 2061ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward); 2063if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 2112ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward); 2113if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward)) 2140ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward); 2142if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 2343int lineIndex = GetLineIndexFromOffset(range.StartIndex, LogicalDirection.Forward);
MS\Internal\Documents\TextContainerHelper.cs (23)
91_textContainer.CreatePointerAtOffset(_cpFirst, LogicalDirection.Forward), 92_textContainer.CreatePointerAtOffset(_cpLast, LogicalDirection.Backward), 101_textContainer.CreatePointerAtOffset(_ranges[i * 2], LogicalDirection.Forward), 102_textContainer.CreatePointerAtOffset(_ranges[i * 2 + 1], LogicalDirection.Backward), 120if (cpPos == _cpFirst && position.LogicalDirection == LogicalDirection.Backward || 121cpPos == _cpLast && position.LogicalDirection == LogicalDirection.Forward) 137if (cpPos == _ranges[i * 2] && position.LogicalDirection == LogicalDirection.Backward || 138cpPos == _ranges[i * 2 + 1] && position.LogicalDirection == LogicalDirection.Forward) 156startPosition = _textContainer.CreatePointerAtOffset(IsSimple ? _cpFirst : _ranges[0], LogicalDirection.Forward); 168endPosition = _textContainer.CreatePointerAtOffset(IsSimple ? _cpLast : _ranges[(_size - 1) * 2 + 1], LogicalDirection.Backward); 320if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 323element = start.GetAdjacentElement(LogicalDirection.Forward); 335start.MoveToNextContextPosition(LogicalDirection.Forward); 341else if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement) 344element = start.GetAdjacentElement(LogicalDirection.Forward); 377if (!start.MoveToNextContextPosition(LogicalDirection.Forward)) 405object element = position.GetAdjacentElement(LogicalDirection.Forward); 443element = position.GetAdjacentElement(LogicalDirection.Forward); 447positionsStart.Insert(0, position.CreatePointer(LogicalDirection.Forward)); 459element = position.GetAdjacentElement(LogicalDirection.Backward); 463positionsEnd.Insert(0, position.CreatePointer(LogicalDirection.Backward)); 548textPointer = textContainer.CreatePointerAtOffset(0, LogicalDirection.Forward); // Start 583internal static ITextPointer GetTextPointerFromCP(ITextContainer textContainer, int cp, LogicalDirection direction)
MS\Internal\Documents\TextDocumentView.cs (29)
295internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 478if (position.LogicalDirection == LogicalDirection.Forward) 488if (segment.Start.LogicalDirection == LogicalDirection.Backward) 497if (position.LogicalDirection == LogicalDirection.Backward) 507if (segment.End.LogicalDirection == LogicalDirection.Forward) 520if (position.TextContainer.Start.CompareTo(position) == 0 && position.LogicalDirection == LogicalDirection.Backward) 524else if (position.TextContainer.End.CompareTo(position) == 0 && position.LogicalDirection == LogicalDirection.Forward) 763position = paragraph.StartPosition.CreatePointer(LogicalDirection.Forward); 767position = paragraph.EndPosition.CreatePointer(LogicalDirection.Backward); 866position = blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward); 870position = blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward); 880position = paragraph.StartPosition.CreatePointer(LogicalDirection.Forward); 884position = paragraph.EndPosition.CreatePointer(LogicalDirection.Backward); 1544private ITextPointer GetNextCaretUnitPosition(ReadOnlyCollection<ParagraphResult> paragraphs, ReadOnlyCollection<ParagraphResult> floatingElements, ITextPointer position, LogicalDirection direction) 1581private ITextPointer GetNextCaretUnitPosition(ParagraphResult paragraph, ITextPointer position, LogicalDirection direction) 1650private ITextPointer GetNextCaretUnitPosition(ReadOnlyCollection<ColumnResult> columns, ReadOnlyCollection<ParagraphResult> floatingElements, ITextPointer position, LogicalDirection direction) 2361lineRange = new TextSegment(blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward), blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward)); 2489positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 2509positionOut = lines[0].StartPosition.CreatePointer(LogicalDirection.Forward); 2521positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 2861positionOut = blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward); 2865positionOut = blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward); 2968positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 2983positionOut = lines[0].StartPosition.CreatePointer(LogicalDirection.Forward); 2995positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 3243segmentEnd = _textContainer.Start.CreatePointer(backgroundFormatInfo.CPInterrupted, LogicalDirection.Backward); 3436if (textPointer.LogicalDirection == LogicalDirection.Forward && textPointer.CompareTo(textElement.ElementStart) == 0) 3441if (textPointer.LogicalDirection == LogicalDirection.Backward && textPointer.CompareTo(textElement.ElementEnd) == 0)
MS\Internal\Documents\TextParagraphView.cs (6)
177positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 206internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 396if (position.LogicalDirection == LogicalDirection.Forward && (lineIndex != lines.Count - 1)) 403if (position.LogicalDirection == LogicalDirection.Backward && lineIndex != 0) 415( position.LogicalDirection == LogicalDirection.Backward || 416(position.LogicalDirection == LogicalDirection.Forward && (lineIndex == lines.Count - 1)))));
MS\Internal\Documents\TextViewBase.cs (2)
89internal abstract ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction); 520ITextPointer ITextView.GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\PtsHost\ContainerParagraph.cs (3)
230ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, prevParagraph.ParagraphEndCharacterPosition, LogicalDirection.Forward); 1008switch (textPointer.GetPointerContext(LogicalDirection.Forward)) 1041TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\FlowDocumentPage.cs (3)
948switch (searchPosition.GetPointerContext(LogicalDirection.Forward)) 951DependencyObject embeddedObject = searchPosition.GetAdjacentElement(LogicalDirection.Forward); 965searchPosition.MoveToNextContextPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\Line.cs (9)
140switch (position.GetPointerContext(LogicalDirection.Forward)) 186ITextPointer startPosition = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara, LogicalDirection.Forward); 187ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward); 190while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 199string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 589position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, cp, LogicalDirection.Forward) as TextPointer; 594type = position.GetPointerContext((charIndex.TrailingLength == 0) ? LogicalDirection.Forward : LogicalDirection.Backward); 604element = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\LineBase.cs (9)
81Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 101endOfRunPosition = position.TextContainer.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 116int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 130Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 134TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 245Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 256TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 299Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object."); 302DependencyObject embeddedObject = position.GetAdjacentElement(LogicalDirection.Forward) as DependencyObject;
MS\Internal\PtsHost\ListParagraph.cs (4)
67TextPointerContext runType = textPointer.GetPointerContext(LogicalDirection.Forward); 70TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 116textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 126textPointer.MoveToNextContextPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\OptimalTextSource.cs (6)
90switch (position.GetPointerContext(LogicalDirection.Forward)) 137ITextPointer startPosition = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara, LogicalDirection.Forward); 138ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward); 141while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 150string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 176ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward);
MS\Internal\PtsHost\TextParaClient.cs (56)
642RectFromDcpSimpleLines(0, 0, LogicalDirection.Forward, TextPointerContext.Text, ref textDetails.u.full, ref rect, ref vrBaseline); 647RectFromDcpCompositeLines(0, 0, LogicalDirection.Forward, TextPointerContext.Text, ref textDetails.u.full, ref rect, ref vrBaseline); 659internal ITextPointer GetTextPosition(int dcp, LogicalDirection direction) 678if (position.LogicalDirection == LogicalDirection.Backward && dcp > 0) 870internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 1090LogicalDirection logicalDirection = (charHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 1631LogicalDirection orientation, 1683if (orientation == LogicalDirection.Forward) 1696if (orientation == LogicalDirection.Backward && originalDcp > 0 && (context == TextPointerContext.Text || context == TextPointerContext.EmbeddedElement)) 1719LogicalDirection orientation, 1780if (orientation == LogicalDirection.Forward) 1790if (orientation == LogicalDirection.Backward && originalDcp > 0 && (context == TextPointerContext.Text || context == TextPointerContext.EmbeddedElement)) 2033ITextPointer position = Paragraph.StructuralCache.TextContainer.CreatePointerAtOffset(Paragraph.ParagraphStartCharacterPosition + dcp, LogicalDirection.Forward); 2035return (TextPointerBase.IsNextToAnyBreak(position, LogicalDirection.Backward)); 2397if (position.LogicalDirection == LogicalDirection.Backward) 2422else if (position.LogicalDirection == LogicalDirection.Forward) 2500if (position.LogicalDirection == LogicalDirection.Backward) 2546else if (position.LogicalDirection == LogicalDirection.Forward) 2582LogicalDirection direction, 2607if (dcp == lineDesc.dcpFirst && direction == LogicalDirection.Backward) 2622else if (dcp >= lineDesc.dcpLim - 1 && direction == LogicalDirection.Forward) 2651if (direction == LogicalDirection.Forward) 2660LogicalDirection logicalDirection; 2661if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == lineDesc.dcpLim) && direction == LogicalDirection.Forward) 2667logicalDirection = LogicalDirection.Backward; 2671logicalDirection = LogicalDirection.Forward; 2674else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == lineDesc.dcpFirst) && direction == LogicalDirection.Backward) 2680logicalDirection = LogicalDirection.Forward; 2684logicalDirection = LogicalDirection.Backward; 2689logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2707LogicalDirection direction, 2741if (dcp == element.dcpFirst && direction == LogicalDirection.Backward) 2781else if (dcp >= element.dcpLim - 1 && direction == LogicalDirection.Forward) 2814if (direction == LogicalDirection.Forward) 2823LogicalDirection logicalDirection; 2824if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == element.dcpLim) && direction == LogicalDirection.Forward) 2830logicalDirection = LogicalDirection.Backward; 2835logicalDirection = LogicalDirection.Forward; 2838else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == element.dcpFirst) && direction == LogicalDirection.Backward) 2844logicalDirection = LogicalDirection.Forward; 2849logicalDirection = LogicalDirection.Backward; 2854logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2930LogicalDirection logicalDirection; 2937logicalDirection = LogicalDirection.Forward; 2941logicalDirection = LogicalDirection.Backward; 2946logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 3056LogicalDirection logicalDirection; 3063logicalDirection = LogicalDirection.Forward; 3067logicalDirection = LogicalDirection.Backward; 3072logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
MS\Internal\PtsHost\TextParagraph.cs (12)
569StructuralCache.CurrentFormatContext.DependentMax = StructuralCache.TextContainer.CreatePointerAtOffset(dcpDependAbsolute, LogicalDirection.Backward); 750StructuralCache.CurrentFormatContext.DependentMax = StructuralCache.TextContainer.CreatePointerAtOffset(dcpDependAbsolute, LogicalDirection.Backward); 861ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, ParagraphStartCharacterPosition + dcpFirst, LogicalDirection.Forward); 864while(textPointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 866TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 885ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, ParagraphStartCharacterPosition + dcpFirst, LogicalDirection.Forward); 894if(textPointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 896TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 905textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 910textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 1190if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1192invalid = (objectElement != position.GetAdjacentElement(LogicalDirection.Forward));
MS\Internal\PtsHost\TextParaLineResult.cs (5)
66internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 108return _owner.GetTextPosition(_dcp + _cchContent, LogicalDirection.Backward); 120return _owner.GetTextPosition(_dcp + _cch - _cchEllipses, LogicalDirection.Forward); 172_startPosition = _owner.GetTextPosition(_dcp, LogicalDirection.Forward); 187_endPosition = _owner.GetTextPosition(_dcp + _cch, LogicalDirection.Backward);
MS\Internal\Text\ComplexLine.cs (17)
41switch (position.GetPointerContext(LogicalDirection.Forward)) 88ITextPointer position = _owner.TextContainer.CreatePointerAtOffset(dcp, LogicalDirection.Backward); 91while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 99string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 282position = new TextPointer(_owner.ContentStart, CalcPositionOffset(charHit), LogicalDirection.Forward); 289type = position.GetPointerContext(LogicalDirection.Forward); 294type = position.GetPointerContext(LogicalDirection.Backward); 305element = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 333Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 352endOfRunPosition = _owner.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 367int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 380Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 384TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 471Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 475TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 521Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object."); 524DependencyObject element = position.GetAdjacentElement(LogicalDirection.Forward) as DependencyObject;
MS\Internal\Text\DynamicPropertyReader.cs (1)
253selected = position.TextContainer.Highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(TextSelection));
MS\Internal\Text\TextLineResult.cs (5)
61internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 101return _owner.TextContainer.CreatePointerAtOffset(_dcp + _cchContent, LogicalDirection.Backward); 117return _owner.TextContainer.CreatePointerAtOffset(_dcp + _cch - _cchEllipses, LogicalDirection.Forward); 169_startPosition = _owner.TextContainer.CreatePointerAtOffset(_dcp, LogicalDirection.Forward); 184_endPosition = _owner.TextContainer.CreatePointerAtOffset(_dcp + _cch, LogicalDirection.Backward);
MS\Internal\Text\TextProperties.cs (1)
233textDecorations = highlights.GetHighlightValue(highlightPosition, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection;
System\Windows\Annotations\AnnotationHelper.cs (4)
672start.MoveToNextInsertionPosition(LogicalDirection.Backward); 673end.MoveToNextInsertionPosition(LogicalDirection.Forward); 855(selection.Start.LogicalDirection == LogicalDirection.Forward)) || 857(selection.End.LogicalDirection == LogicalDirection.Backward)))
System\Windows\Automation\Peers\TextElementAutomationPeer.cs (1)
116TextPointer endPosition = textElement.ContentStart.GetNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Controls\AccessText.cs (6)
578TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 582string text = navigator.GetTextInRun(LogicalDirection.Forward); 617navigator.MoveToNextContextPosition(LogicalDirection.Forward); 626TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 630string text = navigator.GetTextInRun(LogicalDirection.Forward); 653navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Controls\FlowDocumentReader.cs (4)
1949public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom, FlowDocumentReaderViewingMode viewingMode) 1957public LogicalDirection ContentPositionDirection; 1968LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\FlowDocumentScrollViewer.cs (4)
1883public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom) 1890public LogicalDirection ContentPositionDirection; 1900LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\PasswordBox.cs (2)
1061while (start-- > 0 && selectionStart.MoveToNextInsertionPosition(LogicalDirection.Forward)) 1067while (length-- > 0 && selectionEnd.MoveToNextInsertionPosition(LogicalDirection.Forward))
System\Windows\Controls\PasswordTextContainer.cs (20)
211ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 217ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 222ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 229return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 232TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 242int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 247object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 262StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 513return new PasswordTextPointer(this, LogicalDirection.Backward, 0); 527return new PasswordTextPointer(this, LogicalDirection.Forward, this.SymbolCount); 669textPosition = new PasswordTextPointer(this, LogicalDirection.Forward, offset); 706index = FindIndex(offset, LogicalDirection.Forward); 739if (position.LogicalDirection == LogicalDirection.Backward) 803private int FindIndex(int offset, LogicalDirection gravity) 817(position.LogicalDirection == gravity || gravity == LogicalDirection.Backward)) 838LogicalDirection lastLogicalDirection; 841lastLogicalDirection = LogicalDirection.Backward; 853position.LogicalDirection == LogicalDirection.Backward && 858Invariant.Assert(lastLogicalDirection != LogicalDirection.Forward); 909Debug.Write($"({position.DebugId}) {position.Offset}/{((position.LogicalDirection == LogicalDirection.Forward) ? "f " : "b ")}");
System\Windows\Controls\PasswordTextNavigator.cs (27)
25internal PasswordTextPointer(PasswordTextContainer container, LogicalDirection gravity, int offset) 49void ITextPointer.SetLogicalDirection(LogicalDirection direction) 133TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 137if ((direction == LogicalDirection.Backward && _offset == 0) || 138(direction == LogicalDirection.Forward && _offset == _container.SymbolCount)) 165int ITextPointer.GetTextRunLength(LogicalDirection direction) 169if (direction == LogicalDirection.Forward) 182string ITextPointer.GetTextInRun(LogicalDirection direction) 187int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 193if (direction == LogicalDirection.Forward) 222object ITextPointer.GetAdjacentElement(LogicalDirection direction) 242Type ITextPointer.GetElementType(LogicalDirection direction) 327ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 349ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 363ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 418bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 424if (direction == LogicalDirection.Backward) 518Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 523bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 528bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 535ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 550ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 559ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 576ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 648LogicalDirection ITextPointer.LogicalDirection 699internal LogicalDirection LogicalDirection 751private LogicalDirection _gravity;
System\Windows\Controls\RichTextBox.cs (1)
266public TextPointer GetNextSpellingErrorPosition(TextPointer position, LogicalDirection direction)
System\Windows\Controls\SinglePageViewer.cs (4)
1517public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom) 1524public LogicalDirection ContentPositionDirection; 1534LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\TextAdaptor.cs (12)
117TextRangeAdaptor.MoveToInsertionPosition(start, LogicalDirection.Forward); 118TextRangeAdaptor.MoveToInsertionPosition(end, LogicalDirection.Backward); 272FrameworkContentElement element = pointer.GetAdjacentElement(LogicalDirection.Backward) as FrameworkContentElement; 608TextPointerContext context = position.GetPointerContext(LogicalDirection.Forward); 611if (childElement == position.GetAdjacentElement(LogicalDirection.Forward)) 613rangeStart = position.CreatePointer(LogicalDirection.Forward); 615rangeEnd = position.CreatePointer(LogicalDirection.Backward); 621if (childElement == position.GetAdjacentElement(LogicalDirection.Forward)) 623rangeStart = position.CreatePointer(LogicalDirection.Forward); 624position.MoveToNextContextPosition(LogicalDirection.Forward); 625rangeEnd = position.CreatePointer(LogicalDirection.Backward); 629position.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Controls\TextBlock.cs (29)
2132LogicalDirection logicalDirection; 2134logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2166if (orientedPosition.LogicalDirection == LogicalDirection.Backward && characterIndex > 0) 2224if (orientedPosition.LogicalDirection == LogicalDirection.Forward || originalCharacterIndex == 0) 2234if (orientedPosition.LogicalDirection == LogicalDirection.Backward && originalCharacterIndex > 0) 2327&& TextPointerBase.IsNextToAnyBreak(endOfLineTextPointer, LogicalDirection.Backward)) 2378if (position.LogicalDirection == LogicalDirection.Backward) 2392else if (position.LogicalDirection == LogicalDirection.Forward) 2434internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction, int dcp, int lineIndex) 2445if (characterIndex == dcp && direction == LogicalDirection.Backward) 2462else if (characterIndex == (dcp + GetLine(lineIndex).Length) && direction == LogicalDirection.Forward) 2498if (direction == LogicalDirection.Forward) 2511LogicalDirection logicalDirection; 2512if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == (dcp + GetLine(lineIndex).Length)) && direction == LogicalDirection.Forward) 2518logicalDirection = LogicalDirection.Backward; 2522logicalDirection = LogicalDirection.Forward; 2525else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == dcp) && direction == LogicalDirection.Backward) 2531logicalDirection = LogicalDirection.Forward; 2535logicalDirection = LogicalDirection.Backward; 2540logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2612LogicalDirection logicalDirection; 2619logicalDirection = LogicalDirection.Forward; 2623logicalDirection = LogicalDirection.Backward; 2628logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 3649switch (position.GetPointerContext(LogicalDirection.Forward)) 3652DependencyObject embeddedObject = position.GetAdjacentElement(LogicalDirection.Forward);
System\Windows\Controls\TextBox.cs (24)
160TextPointer newStart = this.TextContainer.CreatePointerAtOffset(start, LogicalDirection.Forward); 164newStart = newStart.GetInsertionPosition(LogicalDirection.Forward); 172TextPointer newEnd = new TextPointer(newStart, length, LogicalDirection.Forward); 175newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 215return (textPointer.LogicalDirection == LogicalDirection.Backward) ? offset - 1 : offset; 263TextPointer position = this.TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Forward); 438TextPointer textPointer = TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Backward); 439textPointer = textPointer.GetInsertionPosition(LogicalDirection.Backward); 444textPointer = textPointer.GetNextInsertionPosition(LogicalDirection.Forward); 448textPointer = textPointer.GetPositionAtOffset(0, LogicalDirection.Backward); 453textPointer = textPointer.GetPositionAtOffset(0, LogicalDirection.Forward); 478TextPointer position = this.TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Forward); 479SpellingError spellingError = this.TextEditor.GetSpellingErrorAtPosition(position, LogicalDirection.Forward); 483position = this.TextContainer.CreatePointerAtOffset(charIndex + 1, LogicalDirection.Forward); 484spellingError = this.TextEditor.GetSpellingErrorAtPosition(position, LogicalDirection.Backward); 544public int GetNextSpellingErrorCharacterIndex(int charIndex, LogicalDirection direction) 810TextPointer newEnd = new TextPointer(TextSelectionInternal.Start, value, LogicalDirection.Forward); 813newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 854TextPointer newStart = TextContainer.CreatePointerAtOffset(value, LogicalDirection.Forward); 858newStart = newStart.GetInsertionPosition(LogicalDirection.Forward); 866TextPointer newEnd = new TextPointer(newStart, selectionLength, LogicalDirection.Forward); 869newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 1476if (TextPointerBase.IsNextToPlainLineBreak(textPointer, LogicalDirection.Forward)) 1478textPointer.MoveToNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Controls\TextRangeAdaptor.cs (77)
479internal static bool MoveToInsertionPosition(ITextPointer position, LogicalDirection direction) 527TextPointerBase.MoveToNextInsertionPosition(_start, LogicalDirection.Backward); 531TextPointerBase.MoveToNextInsertionPosition(_end, LogicalDirection.Forward); 538MoveToNextWordBoundary(_start, LogicalDirection.Backward); 542MoveToNextWordBoundary(_end, LogicalDirection.Forward); 552TextPointerContext forwardContext = _start.GetPointerContext(LogicalDirection.Forward); 555TextPointerContext backwardContext = _start.GetPointerContext(LogicalDirection.Backward); 563_start.MoveToNextContextPosition(LogicalDirection.Backward); 569TextPointerContext backwardContext = _end.GetPointerContext(LogicalDirection.Backward); 572TextPointerContext forwardContext = _end.GetPointerContext(LogicalDirection.Forward); 580_end.MoveToNextContextPosition(LogicalDirection.Forward); 586_start.SetLogicalDirection(LogicalDirection.Forward); 587_end.SetLogicalDirection(LogicalDirection.Forward); 724private bool MoveToUnitBoundary(ITextPointer position, bool isStart, LogicalDirection direction, TextUnit unit) 762if (moved && direction == LogicalDirection.Forward) 766TextPointerContext context = position.GetPointerContext(LogicalDirection.Forward); 771position.MoveToNextContextPosition(LogicalDirection.Forward); 790if (direction == LogicalDirection.Forward) 808nextLineStart = GetInsertionPosition(nextLineStart, LogicalDirection.Forward); 813position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 835previousLineEnd = GetInsertionPosition(previousLineEnd, LogicalDirection.Backward); 840position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 853if (direction == LogicalDirection.Forward) 860if (nextParagraphStart.MoveToNextInsertionPosition(LogicalDirection.Forward)) 870position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 881if (previousParagraphEnd.MoveToNextInsertionPosition(LogicalDirection.Backward)) 891position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 920if (direction == LogicalDirection.Forward) 924if (position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementEnd) 930Invariant.Assert(position.MoveToNextContextPosition(LogicalDirection.Forward)); 932MoveToInsertionPosition(position, LogicalDirection.Forward); 938if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart) 944Invariant.Assert(position.MoveToNextContextPosition(LogicalDirection.Backward)); 946MoveToInsertionPosition(position, LogicalDirection.Backward); 953if (direction == LogicalDirection.Forward) 955if (position.CompareTo(GetInsertionPosition(position.TextContainer.End, LogicalDirection.Backward)) != 0) 963if (position.CompareTo(GetInsertionPosition(position.TextContainer.Start, LogicalDirection.Forward)) != 0) 993LogicalDirection direction = (count > 0) ? LogicalDirection.Forward : LogicalDirection.Backward; 1050if (direction == LogicalDirection.Backward) 1052while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) 1054if (!position.MoveToNextContextPosition(LogicalDirection.Backward)) 1074position.SetLogicalDirection(LogicalDirection.Forward); 1091position.MoveToNextInsertionPosition(LogicalDirection.Backward); 1096MoveToInsertionPosition(position, LogicalDirection.Forward); 1111position.MoveToPosition(direction == LogicalDirection.Forward ? paragraphRange.End : paragraphRange.Start); 1142if (direction == LogicalDirection.Backward) 1145MoveToInsertionPosition(position, LogicalDirection.Backward); 1150MoveToInsertionPosition(position, LogicalDirection.Forward); 1162if (direction == LogicalDirection.Forward) 1195return (direction == LogicalDirection.Forward) ? moved : -moved; 1210while (IsElementBoundary(start.GetPointerContext(LogicalDirection.Forward))) 1212if (!start.MoveToNextContextPosition(LogicalDirection.Forward) || start.CompareTo(end) >= 0) 1217while (IsElementBoundary(end.GetPointerContext(LogicalDirection.Backward))) 1219if (!end.MoveToNextContextPosition(LogicalDirection.Backward) || start.CompareTo(end) >= 0) 1234if (!start.MoveToNextContextPosition(LogicalDirection.Forward) || start.CompareTo(end) > 0) 1445return TextPointerBase.IsAtWordBoundary(position, LogicalDirection.Forward); 1453private static bool MoveToNextWordBoundary(ITextPointer position, LogicalDirection direction) 1479position.SetLogicalDirection(LogicalDirection.Forward); 1504private ITextPointer GetInsertionPosition(ITextPointer position, LogicalDirection direction) 1637_end.MoveToNextInsertionPosition(LogicalDirection.Forward); 1672ITextPointer position = _end.CreatePointer(LogicalDirection.Backward); 1683attrEnd = position.CreatePointer(LogicalDirection.Backward); 1690attrStart = position.CreatePointer(LogicalDirection.Forward); 1694if (!position.MoveToNextContextPosition(LogicalDirection.Backward)) 1703ITextPointer position = _start.CreatePointer(LogicalDirection.Forward); 1714attrStart = position.CreatePointer(LogicalDirection.Forward); 1721attrEnd = position.CreatePointer(LogicalDirection.Backward); 1725if (!position.MoveToNextContextPosition(LogicalDirection.Forward)) 1908_end.MoveToNextInsertionPosition(LogicalDirection.Forward); 1946if (MoveToUnitBoundary(position, start, count < 0 ? LogicalDirection.Backward : LogicalDirection.Forward, unit))
System\Windows\Documents\BlockUIContainer.cs (1)
71return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement;
System\Windows\Documents\ColumnResizeUndoUnit.cs (1)
45textPointerTable = new TextPointer(_textContainer.Start, _cpTable, LogicalDirection.Forward);
System\Windows\Documents\CompositionAdorner.cs (12)
326ITextPointer rangeStart = start.CreatePointer(LogicalDirection.Forward); 327ITextPointer rangeEnd = end.CreatePointer(LogicalDirection.Backward); 480ITextPointer start = _textView.TextContainer.Start.CreatePointer(_startOffset, LogicalDirection.Forward); 481ITextPointer end = _textView.TextContainer.Start.CreatePointer(_endOffset, LogicalDirection.Backward); 483while (start.CompareTo(end) < 0 && start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 485start.MoveToNextContextPosition(LogicalDirection.Forward); 488Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 602endLinePointer = textSegment.End.CreatePointer(LogicalDirection.Backward); 617startLinePointer = textSegment.End.CreatePointer(LogicalDirection.Forward); 622while ((startLinePointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) && 623(startLinePointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text)) 625startLinePointer.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (3)
49internal override object GetHighlightValue(StaticTextPointer staticTextPointer, LogicalDirection direction) 57internal override bool IsContentHighlighted(StaticTextPointer staticTextPointer, LogicalDirection direction) 64internal override StaticTextPointer GetNextChangePosition(StaticTextPointer staticTextPointer, LogicalDirection direction)
System\Windows\Documents\DocumentSequenceTextContainer.cs (25)
94ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 100ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 105ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 112return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 115TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 125int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 130object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 145StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 659if (!highlights.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 661highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 669selected = highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)); 673highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 680if (highlightRangeStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 687TextPointerBase.GetTextWithLimit(highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), LogicalDirection.Forward, sb, 0, 256, highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward)); 862internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 883internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 905internal override StaticTextPointer GetNextHighlightChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 948internal override StaticTextPointer GetNextPropertyChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 973private bool EnsureParentPosition(StaticTextPointer textPosition, LogicalDirection direction, out StaticTextPointer parentPosition) 987ITextPointer dynamicTextPointer = textPosition.CreateDynamicTextPointer(LogicalDirection.Forward); 1005private StaticTextPointer GetStaticPositionInChildContainer(StaticTextPointer textPosition, LogicalDirection direction, StaticTextPointer originalPosition) 1011DocumentSequenceTextPointer parentChangePosition = textPosition.CreateDynamicTextPointer(LogicalDirection.Forward) as DocumentSequenceTextPointer; 1024childTp = direction == LogicalDirection.Forward ?
System\Windows\Documents\DocumentSequenceTextPointer.cs (52)
46void ITextPointer.SetLogicalDirection(LogicalDirection direction) 79TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 88int ITextPointer.GetTextRunLength(LogicalDirection direction) 94string ITextPointer.GetTextInRun(LogicalDirection direction) 100/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 103int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 112object ITextPointer.GetAdjacentElement(LogicalDirection direction) 121Type ITextPointer.GetElementType(LogicalDirection direction) 189/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 191ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 197/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 199ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 213ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 242ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 257ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 268ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 277ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 358if (!isAtCaretUnitBoundary && ((ITextPointer)this).LogicalDirection == LogicalDirection.Backward) 366ITextPointer positionForwardGravity = ((ITextPointer)this).CreatePointer(LogicalDirection.Forward); 376LogicalDirection ITextPointer.LogicalDirection 441bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 474LogicalDirection gravity = this.ChildPointer.LogicalDirection; 504Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 509bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 514bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 629public static TextPointerContext GetPointerContext(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 640public static int GetTextRunLength(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 648/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 651public static int GetTextInRun(DocumentSequenceTextPointer thisTp, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 680public static object GetAdjacentElement(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 691public static Type GetElementType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 764public static ITextPointer CreatePointer(DocumentSequenceTextPointer thisTp, LogicalDirection gravity) 770/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 772public static ITextPointer CreatePointer(DocumentSequenceTextPointer thisTp, int distance, LogicalDirection gravity) 817internal static bool iScan(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 822moved = xGapAwareScan(thisTp, (direction == LogicalDirection.Forward ? 1 : -1)); 862private static DocumentSequenceTextPointer xGetClingDSTP(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 874if (direction == LogicalDirection.Forward) 887Debug.Assert(direction == LogicalDirection.Backward); 912private static TextPointerContext xGapAwareGetSymbolType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 919private static object xGapAwareGetEmbeddedElement(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 963if (tp1.ChildPointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None || 964tp2.ChildPointer.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.None) 973if (block.ChildContainer.Start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) 1028LogicalDirection scanDir = (distance > 0 ? LogicalDirection.Forward : LogicalDirection.Backward); 1056if (scanDir == LogicalDirection.Backward) 1064if (!((cdb.IsHead && scanDir == LogicalDirection.Backward) 1065|| (cdb.IsTail && scanDir == LogicalDirection.Forward) 1069cdb = (scanDir == LogicalDirection.Forward ? cdb.NextBlock : cdb.PreviousBlock); 1070childTn = (scanDir == LogicalDirection.Forward ?
System\Windows\Documents\DocumentSequenceTextView.cs (5)
73LogicalDirection edge = LogicalDirection.Forward; 204LogicalDirection newEdge = LogicalDirection.Forward; 297internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
System\Windows\Documents\FixedDocument.cs (11)
497fixedTextPointer = new FixedTextPointer(true, LogicalDirection.Forward, flowPosition); 1070if (!highlights.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 1072highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1083selected = highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)); 1101highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1104while (highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)) != DependencyProperty.UnsetValue); 1113LogicalDirection.Forward, typeof(HighlightComponent)) as AnnotationHighlightLayer.HighlightSegment; 1117highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1127this.FixedContainer.GetMultiHighlights((FixedTextPointer)highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), 1128(FixedTextPointer)highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward), 1430return new FixedTextPointer(true, LogicalDirection.Forward, flowPosition);
System\Windows\Documents\FixedElement.cs (6)
266TextPointerContext tpc = pos.GetPointerContext(LogicalDirection.Forward); 269root.AddText(pos.GetTextInRun(LogicalDirection.Forward)); 273root.AddChild(pos.GetAdjacentElement(LogicalDirection.Forward)); 277object obj = pos.GetAdjacentElement(LogicalDirection.Forward); 281pos.MoveToNextContextPosition(LogicalDirection.Forward); 286pos.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\FixedFindEngine.cs (12)
147end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber))); 148start = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Forward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageStartFlowPosition(translatedPageNumber))); 152start = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Forward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageStartFlowPosition(translatedPageNumber))); 153end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber))); 162end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber)); 163start = new FixedTextPointer(false, LogicalDirection.Forward, textBuilder.GetPageStartFlowPosition(pageNumber)); 167start = new FixedTextPointer(false, LogicalDirection.Forward, textBuilder.GetPageStartFlowPosition(pageNumber)); 168end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber)); 300new FixedTextPointer(false, LogicalDirection.Forward,pageStartFlowPosition)); 306firstSearchPageStart = new FixedTextPointer(false, LogicalDirection.Forward, endAsFTP.FixedTextContainer.FixedTextBuilder.GetPageStartFlowPosition(pageNumber)); 320new FixedTextPointer(false, LogicalDirection.Backward, pageEndFlowPosition)); 326firstSearchPageEnd = new FixedTextPointer(false, LogicalDirection.Backward, startAsFTP.FixedTextContainer.FixedTextBuilder.GetPageEndFlowPosition(pageNumber));
System\Windows\Documents\FixedTextBuilder.cs (2)
386internal bool GetFixedPosition(FlowPosition position, LogicalDirection textdir, out FixedPosition fixedp) 420textdir == LogicalDirection.Backward &&
System\Windows\Documents\FixedTextContainer.cs (12)
79ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 85ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 90ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 97return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 100TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 110int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 115object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 130StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 568_start = new FixedTextPointer(false, LogicalDirection.Backward, new FlowPosition(this, this.FixedTextBuilder.FixedFlowMap.FlowStartEdge, 1)); 569_end = new FixedTextPointer(false, LogicalDirection.Forward, new FlowPosition(this, this.FixedTextBuilder.FixedFlowMap.FlowEndEdge, 0)); 578FixedTextPointer eStart = new FixedTextPointer(false, LogicalDirection.Backward, pStart); 579FixedTextPointer eEnd = new FixedTextPointer(false, LogicalDirection.Forward, pEnd);
System\Windows\Documents\FixedTextPointer.cs (27)
30internal FixedTextPointer(bool mutable, LogicalDirection gravity, FlowPosition flow) 92TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 102int ITextPointer.GetTextRunLength(LogicalDirection direction) 113string ITextPointer.GetTextInRun(LogicalDirection direction) 119/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 122int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 142object ITextPointer.GetAdjacentElement(LogicalDirection direction) 157Type ITextPointer.GetElementType(LogicalDirection direction) 258/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 260ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 266/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 268ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 292ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 301ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 319ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 333ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 345ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 365void ITextPointer.SetLogicalDirection(LogicalDirection direction) 375bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 462Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 470bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 478bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 568if (!isAtCaretUnitBoundary && this.LogicalDirection == LogicalDirection.Backward) 576ITextPointer positionForwardGravity = ((ITextPointer)this).CreatePointer(LogicalDirection.Forward); 586LogicalDirection ITextPointer.LogicalDirection 661internal LogicalDirection LogicalDirection 694private LogicalDirection _gravity;
System\Windows\Documents\FixedTextView.cs (43)
74textPos = _CreateTextPointer(fixedp, LogicalDirection.Backward); 97pos = _CreateTextPointer(fixedp, LogicalDirection.Forward); 104pos = _CreateTextPointer(fixedp, LogicalDirection.Forward); 175if (position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) 334LogicalDirection edge = position.LogicalDirection; 335LogicalDirection scanDir = LogicalDirection.Forward; 356scanDir = LogicalDirection.Backward; 370linesMoved = (scanDir == LogicalDirection.Forward) ? 1 : -1; 395if (scanDir == LogicalDirection.Backward) 501internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 517CharacterHit next = (direction == LogicalDirection.Forward) ? 523LogicalDirection edge = LogicalDirection.Forward; 526edge = LogicalDirection.Backward; 604ITextPointer begin = _CreateTextPointer(new FixedPosition(fixedNodes[0], 0), LogicalDirection.Forward); 605ITextPointer end = _CreateTextPointer(new FixedPosition(lastNode, lastIndex), LogicalDirection.Backward); 637(tp.CompareTo(this.Start) == 0 && (tp.LogicalDirection == LogicalDirection.Forward || this.IsContainerStart)) || 638(tp.CompareTo(this.End) == 0 && (tp.LogicalDirection == LogicalDirection.Backward || this.IsContainerEnd)) 732_start = new FixedTextPointer(false, LogicalDirection.Forward, flowStart); 745_end = new FixedTextPointer(false, LogicalDirection.Backward, flowEnd); 784private void _GlyphRunHitTest(Glyphs g, double xoffset, out int charIndex, out LogicalDirection edge) 787edge = LogicalDirection.Forward; 805edge = (hit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 845LogicalDirection dir; 859itp = ((ITextPointer)this.Start).CreatePointer(LogicalDirection.Forward); 860itp.MoveToInsertionPosition(LogicalDirection.Forward); 864itp = ((ITextPointer)this.End).CreatePointer(LogicalDirection.Backward); 865itp.MoveToInsertionPosition(LogicalDirection.Backward); 874private bool _GetNextLineGlyphs(ref FixedPosition fixedp, ref LogicalDirection edge, double suggestedX, LogicalDirection scanDir) 879FixedNode[] fixedNodes = Container.FixedTextBuilder.GetNextLine(fixedp.Node, (scanDir == LogicalDirection.Forward), ref count); 1072LogicalDirection textdir = ftp.LogicalDirection; 1086textdir = LogicalDirection.Forward; 1089textdir = LogicalDirection.Backward; 1126LogicalDirection dir = LogicalDirection.Forward; 1130dir = LogicalDirection.Backward; 1159private ITextPointer _CreateTextPointer(FixedPosition fixedPosition, LogicalDirection edge) 1181LogicalDirection edge; 1191LogicalDirection dir = textPointer.LogicalDirection; 1192int increment = (dir == LogicalDirection.Forward ? +1 : -1);
System\Windows\Documents\FlowDocument.cs (1)
1481segmentEnd = args.ITextPosition.CreatePointer(args.Count, LogicalDirection.Forward);
System\Windows\Documents\FlowPosition.cs (30)
161int scan = flowScan._vScan(LogicalDirection.Forward, -1); 171internal TextPointerContext GetPointerContext(LogicalDirection dir) 173Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 179internal int GetTextRunLength(LogicalDirection dir) 184if (dir == LogicalDirection.Forward) 196internal int GetTextInRun(LogicalDirection dir, int maxLength, char[] chars, int startIndex) 205if (dir == LogicalDirection.Forward) 222if (dir == LogicalDirection.Forward) 235internal object GetAdjacentElement(LogicalDirection dir) 268internal FixedElement GetElement(LogicalDirection dir) 284(tst = flowScan.GetPointerContext(LogicalDirection.Backward))!= TextPointerContext.None) 290FlowPosition flowEnd = flowScan.GetClingPosition(LogicalDirection.Backward); 300flowScan.Move(LogicalDirection.Backward); 309LogicalDirection dir = (distance >= 0 ? LogicalDirection.Forward : LogicalDirection.Backward); 331internal bool Move(LogicalDirection dir) 359internal void GetFlowNode(LogicalDirection direction, out FlowNode flowNode, out int offsetStart) 375FlowPosition flowScan = GetClingPosition(LogicalDirection.Forward); 383int scan = flowScan._vScan(LogicalDirection.Forward, distance); 396internal FlowPosition GetClingPosition(LogicalDirection dir) 401if (dir == LogicalDirection.Forward) 423Debug.Assert(dir == LogicalDirection.Backward); 544private int _vScan(LogicalDirection dir, int limit) 553if (dir == LogicalDirection.Forward) 581Debug.Assert(dir == LogicalDirection.Backward); 612private TextPointerContext _vGetSymbolType(LogicalDirection dir) 615if (dir == LogicalDirection.Forward) 631Debug.Assert(dir == LogicalDirection.Backward);
System\Windows\Documents\FrameworkRichTextComposition.cs (4)
44return _ResultStart == null ? null : (TextPointer)_ResultStart.GetFrozenPointer(LogicalDirection.Backward); 55return _ResultEnd == null ? null : (TextPointer)_ResultEnd.GetFrozenPointer(LogicalDirection.Forward); 66return _CompositionStart == null ? null : (TextPointer)_CompositionStart.GetFrozenPointer(LogicalDirection.Backward); 77return _CompositionEnd == null ? null : (TextPointer)_CompositionEnd.GetFrozenPointer(LogicalDirection.Forward);
System\Windows\Documents\FrameworkTextComposition.cs (4)
194_resultStart = start.GetFrozenPointer(LogicalDirection.Backward); 195_resultEnd = end.GetFrozenPointer(LogicalDirection.Forward); 215_compositionStart = start.GetFrozenPointer(LogicalDirection.Backward); 216_compositionEnd = end.GetFrozenPointer(LogicalDirection.Forward);
System\Windows\Documents\HighlightLayer.cs (3)
39internal abstract object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction); 50internal abstract bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction); 62internal abstract StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction);
System\Windows\Documents\Highlights.cs (11)
59internal virtual object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 92internal virtual bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 117internal virtual StaticTextPointer GetNextHighlightChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 136else if (direction == LogicalDirection.Forward) 174internal virtual StaticTextPointer GetNextPropertyChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 187characterRunEndPosition = textPosition.GetNextContextPosition(LogicalDirection.Forward); 352if (!highlightLayer.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 354highlightTransitionPosition = highlightLayer.GetNextChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 362highlightTransitionPosition = highlightLayer.GetNextChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 365ranges.Add(new TextSegment(highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward)));
System\Windows\Documents\Hyperlink.cs (2)
104Hyperlink hyperlink = navigator.GetAdjacentElement(LogicalDirection.Forward) as Hyperlink; 112navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\ImmComposition.cs (25)
624caretNavigator = _caretOffset > 0 ? _startComposition.CreatePointer(_caretOffset, LogicalDirection.Forward) : _endComposition; 631ITextPointer startPosition = startNavigator.CreatePointer(LogicalDirection.Forward); 632ITextPointer endPosition = endNavigator.CreatePointer(LogicalDirection.Backward); 633ITextPointer caretPosition = caretNavigator.CreatePointer(LogicalDirection.Forward); 753rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 1123start = range.Start.CreatePointer(resultLength, LogicalDirection.Forward); 1127ITextPointer caretPosition = _caretOffset >= 0 ? start.CreatePointer(_caretOffset, LogicalDirection.Forward) : end; 1166ITextPointer startAttribute = _startComposition.CreatePointer(startOffset, LogicalDirection.Backward); 1167ITextPointer endAttribute = _startComposition.CreatePointer(i + 1, LogicalDirection.Forward); 1397switch (navigator.GetPointerContext(LogicalDirection.Backward)) 1401int copied = navigator.GetTextInRun(LogicalDirection.Backward, buffer, 0, buffer.Length); 1415if (!navigator.GetElementType(LogicalDirection.Backward).IsSubclassOf(typeof(Inline))) 1419navigator.MoveToNextContextPosition(LogicalDirection.Backward); 1428navigator.MoveToNextContextPosition(LogicalDirection.Backward); 1449switch (navigator.GetPointerContext(LogicalDirection.Forward)) 1453int copied = navigator.GetTextInRun(LogicalDirection.Forward, buffer, 0, buffer.Length); 1466if (!navigator.GetElementType(LogicalDirection.Forward).IsSubclassOf(typeof(Inline))) 1470navigator.MoveToNextContextPosition(LogicalDirection.Forward); 1478navigator.MoveToNextContextPosition(LogicalDirection.Forward); 1521ITextPointer start = range.Start.CreatePointer(LogicalDirection.Backward); 1526ITextPointer end = start.CreatePointer(LogicalDirection.Forward); 1548switch (position.GetPointerContext(LogicalDirection.Backward)) 1564switch (position.GetPointerContext(LogicalDirection.Forward)) 1651positionNext.MoveToNextInsertionPosition(LogicalDirection.Forward); 1655positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward);
System\Windows\Documents\InlineUIContainer.cs (1)
95return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement;
System\Windows\Documents\ITextContainer.cs (7)
36ITextPointer CreatePointerAtOffset(int offset, LogicalDirection direction); 41ITextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction); 43ITextPointer CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction); 47TextPointerContext GetPointerContext(StaticTextPointer pointer, LogicalDirection direction); 51int GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count); 53object GetAdjacentElement(StaticTextPointer position, LogicalDirection direction); 59StaticTextPointer GetNextContextPosition(StaticTextPointer position, LogicalDirection direction);
System\Windows\Documents\ITextPointer.cs (19)
32ITextPointer CreatePointer(LogicalDirection gravity); 35ITextPointer CreatePointer(int offset, LogicalDirection gravity); 38void SetLogicalDirection(LogicalDirection direction); 51TextPointerContext GetPointerContext(LogicalDirection direction); 57int GetTextRunLength(LogicalDirection direction); 60string GetTextInRun(LogicalDirection direction); 63int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count); 70object GetAdjacentElement(LogicalDirection direction); 79bool MoveToNextContextPosition(LogicalDirection direction); 82ITextPointer GetNextContextPosition(LogicalDirection direction); 85bool MoveToInsertionPosition(LogicalDirection direction); 88ITextPointer GetInsertionPosition(LogicalDirection direction); 91ITextPointer GetFormatNormalizedPosition(LogicalDirection direction); 94bool MoveToNextInsertionPosition(LogicalDirection direction); 97ITextPointer GetNextInsertionPosition(LogicalDirection direction); 106Rect GetCharacterRect(LogicalDirection direction); 112ITextPointer GetFrozenPointer(LogicalDirection logicalDirection); 122Type GetElementType(LogicalDirection direction); 172LogicalDirection LogicalDirection { get; }
System\Windows\Documents\ITextSelection.cs (3)
59void SetCaretToPosition(ITextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace); 70bool ExtendToNextInsertionPosition(LogicalDirection direction); 129bool ExtendToNextTableRow(LogicalDirection direction);
System\Windows\Documents\ITextView.cs (1)
275ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction);
System\Windows\Documents\List.cs (5)
193if (textNav.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 195DependencyObject element = textNav.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 213textNav.MoveToNextContextPosition(LogicalDirection.Forward); 249listItem = block.ElementStart.GetAdjacentElement(LogicalDirection.Backward) as ListItem; 277block = block == lastBlock ? null : (Block)listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward);
System\Windows\Documents\NullTextContainer.cs (10)
34_start = new NullTextPointer(this, LogicalDirection.Backward); 35_end = new NullTextPointer(this, LogicalDirection.Forward); 79ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 85ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 90ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 97return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 100TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 110int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 115object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 130StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction)
System\Windows\Documents\NullTextNavigator.cs (25)
26internal NullTextPointer(NullTextContainer container, LogicalDirection gravity) 68TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 78int ITextPointer.GetTextRunLength(LogicalDirection direction) 85/// <see cref="ITextPointer.GetTextInRun(LogicalDirection)"/> 87string ITextPointer.GetTextInRun(LogicalDirection direction) 93/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 96int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 106object ITextPointer.GetAdjacentElement(LogicalDirection direction) 116Type ITextPointer.GetElementType(LogicalDirection direction) 180/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 182ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 188/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 190ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 206ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 219void ITextPointer.SetLogicalDirection(LogicalDirection direction) 230bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 283Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 292bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 300bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 325ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 343ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 357ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 369ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 451LogicalDirection ITextPointer.LogicalDirection 506private LogicalDirection _gravity;
System\Windows\Documents\Paragraph.cs (2)
252TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 260navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\RangeContentEnumerator.cs (13)
93switch (_navigator.GetPointerContext(LogicalDirection.Forward)) 101runLength = _navigator.GetTextRunLength(LogicalDirection.Forward); 103_navigator.GetTextInRun(LogicalDirection.Forward, _buffer, offset, runLength); 105_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 107while (_navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 115_currentCache = _navigator.GetAdjacentElement(LogicalDirection.Forward); 118_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 123_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 169switch (_navigator.GetPointerContext(LogicalDirection.Forward)) 176_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 178while (_navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text && _navigator.CompareTo(_end) < 0); 183_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 188_navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\RubberbandSelector.cs (1)
327return new FixedTextPointer(false, LogicalDirection.Forward, flowHit);
System\windows\Documents\SelectionWordBreaker.cs (2)
47internal static bool IsAtWordBoundary(char[] text, int position, LogicalDirection insideWordDirection) 52if (insideWordDirection == LogicalDirection.Backward)
System\Windows\Documents\Span.cs (4)
213if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 215position = position.GetNextContextPosition(LogicalDirection.Backward); 217else if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 219position = position.GetNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\Speller.cs (46)
106internal SpellingError GetError(ITextPointer position, LogicalDirection direction, bool forceEvaluation) 140internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, LogicalDirection direction) 189ExpandToWordBreakAndContext(error.Start, LogicalDirection.Backward, language, out ITextPointer contentStart, out ITextPointer contextStart); 190ExpandToWordBreakAndContext(error.End, LogicalDirection.Forward, language, out ITextPointer contentEnd, out ITextPointer contextEnd); 235if (_statusTable.GetError(pointer, LogicalDirection.Forward, out errorStart, out errorEnd)) 245pointer = _statusTable.GetNextErrorTransition(pointer, LogicalDirection.Forward); 662end = GetNextLanguageTransition(start, LogicalDirection.Forward, language, end); 703wordBreakLeft = SearchForWordBreaks(caretPosition, LogicalDirection.Backward, language, 1, false /* stopOnError */); 704wordBreakRight = SearchForWordBreaks(caretPosition, LogicalDirection.Forward, language, 1, false /* stopOnError */); 719FindPositionInSegmentList(textMap, LogicalDirection.Backward, segments, out leftBreakOffset, out rightBreakOffset); 789ExpandToWordBreakAndContext(start, LogicalDirection.Backward, language, out contentStart, out contextStart); 790ExpandToWordBreakAndContext(end, LogicalDirection.Forward, language, out contentEnd, out contextEnd); 1081private void ExpandToWordBreakAndContext(ITextPointer position, LogicalDirection direction, XmlLanguage language, 1091LogicalDirection inwardDirection; 1117inwardDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 1123if (direction == LogicalDirection.Backward) 1158if (direction == LogicalDirection.Backward) 1175if (direction == LogicalDirection.Backward) 1202if (direction == LogicalDirection.Backward) 1231private int FindPositionInSegmentList(TextMap textMap, LogicalDirection direction, ArrayList segments, 1290if (direction == LogicalDirection.Backward) 1311private ITextPointer SearchForWordBreaks(ITextPointer position, LogicalDirection direction, XmlLanguage language, int minWordCount, bool stopOnError) 1329closestErrorPosition = nextErrorTransition.CreateDynamicTextPointer(LogicalDirection.Forward); 1337searchPosition.MoveByOffset(direction == LogicalDirection.Backward ? -ContextBlockSize : +ContextBlockSize); 1342if (direction == LogicalDirection.Backward && closestErrorPosition.CompareTo(searchPosition) > 0 || 1343direction == LogicalDirection.Forward && closestErrorPosition.CompareTo(searchPosition) < 0) 1353if (direction == LogicalDirection.Backward && closestLanguageTransition.CompareTo(searchPosition) > 0 || 1354direction == LogicalDirection.Forward && closestLanguageTransition.CompareTo(searchPosition) < 0) 1360if (direction == LogicalDirection.Backward) 1383private ITextPointer GetNextLanguageTransition(ITextPointer position, LogicalDirection direction, XmlLanguage language, ITextPointer haltPosition) 1387while ((direction == LogicalDirection.Forward && navigator.CompareTo(haltPosition) < 0) || 1388(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) > 0)) 1397if ((direction == LogicalDirection.Forward && navigator.CompareTo(haltPosition) > 0) || 1398(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) < 0)) 1460private void ScanPosition(ITextPointer position, LogicalDirection direction) 1465if (direction == LogicalDirection.Forward) 1654_basePosition = contextStart.GetFrozenPointer(LogicalDirection.Backward); 1681switch (position.GetPointerContext(LogicalDirection.Forward)) 1684runCount = position.GetTextRunLength(LogicalDirection.Forward); 1688position.GetTextInRun(LogicalDirection.Forward, _text, _textLength, runCount); 1724position.MoveToNextContextPosition(LogicalDirection.Forward); 1732position.MoveToNextContextPosition(LogicalDirection.Forward); 1799context = pointer.GetPointerContext(LogicalDirection.Forward); 1802TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Forward)))
System\Windows\Documents\SpellerError.cs (2)
32_start = start.GetFrozenPointer(LogicalDirection.Forward); 33_end = end.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\SpellerHighlightLayer.cs (3)
51internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 68internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 75internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction)
System\Windows\Documents\SpellerStatusTable.cs (20)
90for (index = FindIndex(searchStart.CreateStaticPointer(), LogicalDirection.Forward); index >= 0 && index < _runList.Count; index++) 126runIndex = FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); 162internal bool IsRunType(StaticTextPointer textPosition, LogicalDirection direction, RunType runType) 177internal StaticTextPointer GetNextErrorTransition(StaticTextPointer textPosition, LogicalDirection direction) 192else if (direction == LogicalDirection.Forward) 242internal bool GetError(StaticTextPointer textPosition, LogicalDirection direction, 262internal bool GetRun(StaticTextPointer position, LogicalDirection direction, out RunType runType, out StaticTextPointer end) 277end = (direction == LogicalDirection.Forward) ? GetRunEndPosition(index) : run.Position.CreateStaticPointer(); 307private int GetErrorIndex(StaticTextPointer textPosition, LogicalDirection direction) 330private int FindIndex(StaticTextPointer position, LogicalDirection direction) 347if (direction == LogicalDirection.Forward && position.CompareTo(run.Position) < 0 || 348direction == LogicalDirection.Backward && position.CompareTo(run.Position) <= 0) 353else if (direction == LogicalDirection.Forward && position.CompareTo(GetRunEndPosition(index)) >= 0 || 354direction == LogicalDirection.Backward && position.CompareTo(GetRunEndPosition(index)) > 0) 390startIndex = FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); 391endIndex = FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); 426endIndex = FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); 591index = FindIndex(position.CreateStaticPointer(), LogicalDirection.Backward); 750return GetRunEndPosition(index).CreateDynamicTextPointer(LogicalDirection.Forward); 798_position = position.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\StaticTextPointer.cs (5)
44internal ITextPointer CreateDynamicTextPointer(LogicalDirection direction) 51internal TextPointerContext GetPointerContext(LogicalDirection direction) 65internal int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 72internal object GetAdjacentElement(LogicalDirection direction) 86internal StaticTextPointer GetNextContextPosition(LogicalDirection direction)
System\Windows\Documents\TextContainer.cs (36)
428ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 436internal TextPointer CreatePointerAtOffset(int offset, LogicalDirection direction) 445ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 459internal TextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 472ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 499TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 510else if (direction == LogicalDirection.Forward) 512edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 517edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward); 549int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 565object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 612StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 629edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd; 635TextTreeTextNode nextTextNode = ((direction == LogicalDirection.Forward) ? node.GetNextNode() : node.GetPreviousNode()) as TextTreeTextNode; 640edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd; 644else if (direction == LogicalDirection.Forward) 646edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 651edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward); 823LogicalDirection direction; 857originalPosition = this.HasListeners ? new TextPointer(position, LogicalDirection.Backward) : null; 869direction = LogicalDirection.Backward; 873direction = LogicalDirection.Forward; 882if ((direction == LogicalDirection.Backward && textNode.AfterEndReferenceCount) || 883(direction == LogicalDirection.Forward && textNode.BeforeStartReferenceCount)) 1040newFirstIMEVisibleNode = startPosition.GetAdjacentTextElementNodeSibling(LogicalDirection.Forward); 1259deletePosition = new TextPointer(startPosition, LogicalDirection.Forward); 1585if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward) 1593TextPointer positionForwardGravity = position.GetPositionAtOffset(0, LogicalDirection.Forward); 1628startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward); 1659endPosition = new TextPointer(this, _rootNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 2410node = startPosition.GetAdjacentSiblingNode(LogicalDirection.Forward); 2411stopNode = endPosition.GetAdjacentSiblingNode(LogicalDirection.Forward); 2763startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward); 2768endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward); 3389TextElement adjacentElement = startPosition.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 3392nextIMEVisibleNode = (TextTreeTextElementNode)endPosition.GetAdjacentSiblingNode(LogicalDirection.Forward);
System\Windows\Documents\TextContainerChangeEventArgs.cs (1)
31_textPosition = textPosition.GetFrozenPointer(LogicalDirection.Forward);
System\windows\Documents\TextEditor.cs (5)
398internal SpellingError GetSpellingErrorAtPosition(ITextPointer position, LogicalDirection direction) 410internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, LogicalDirection direction) 1205string textAdjacent = textContainer.TextSelection.AnchorPosition.GetTextInRun(LogicalDirection.Backward); 1496if (cursorPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null && 1500lastCharacterRect = cursorPosition.GetCharacterRect(LogicalDirection.Backward);
System\windows\Documents\TextEditorContextMenu.cs (7)
169LogicalDirection direction; 180direction = LogicalDirection.Backward; 188direction = LogicalDirection.Forward; 192direction = LogicalDirection.Forward; 258private static void GetClippedPositionOffsets(TextEditor This, ITextPointer position, LogicalDirection direction, 399while (position.GetAdjacentElement(LogicalDirection.Forward) is Inline) 401position = position.GetNextContextPosition(LogicalDirection.Forward);
System\windows\Documents\TextEditorCopyPaste.cs (3)
397This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 950start = start.GetPositionAtOffset(0, LogicalDirection.Backward); 951TextPointer end = start.GetPositionAtOffset(0, LogicalDirection.Forward);
System\windows\Documents\TextEditorDragDrop.cs (5)
463!TextPointerBase.IsAtWordBoundary(dropPosition, /*insideWordDirection:*/LogicalDirection.Forward) && 466TextPointerBase.IsAtWordBoundary(_dragSourceTextRange.Start, LogicalDirection.Forward) && // 467TextPointerBase.IsAtWordBoundary(_dragSourceTextRange.End, LogicalDirection.Forward)) 547selection.SetCaretToPosition(dropPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 575selection.SetCaretToPosition(dropPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true);
System\windows\Documents\TextEditorMouse.cs (6)
557if (snappedCursorPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null && 561Rect lastCharacterRect = snappedCursorPosition.GetCharacterRect(LogicalDirection.Backward); 731LogicalDirection otherEdgeDirection = (mouseMovePosition.LogicalDirection == LogicalDirection.Forward) ? 732LogicalDirection.Backward : LogicalDirection.Forward;
System\windows\Documents\TextEditorSelection.cs (91)
112ITextPointer lineStart = position.CreatePointer(LogicalDirection.Forward); 114ITextPointer lineEnd = position.CreatePointer(LogicalDirection.Backward); 187LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 203LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 220LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 236LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 312ITextPointer nextPosition = lineEndPosition.GetNextInsertionPosition(LogicalDirection.Forward); 402ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward); 463if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Forward)) 467This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 472This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 516This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 521if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward)) 525This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 802ITextPointer caretPosition = lineRange.Start.GetFrozenPointer(LogicalDirection.Forward); 805This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 851LogicalDirection orientation = TextPointerBase.IsNextToPlainLineBreak(lineRange.End, LogicalDirection.Backward) ? LogicalDirection.Forward : LogicalDirection.Backward; 885This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 914This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 945LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 961LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 977LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 993LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 1011if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1069ITextPointer nextPosition = lineEndPosition.GetNextInsertionPosition(LogicalDirection.Forward); 1121if (TextPointerBase.IsNextToAnyBreak(newMovingPosition, LogicalDirection.Forward) || 1122newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null) 1131newMovingPosition = newMovingPosition.GetInsertionPosition(LogicalDirection.Forward); 1132newMovingPosition = newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward); 1141newMovingPosition = newMovingPosition.GetFrozenPointer(LogicalDirection.Backward); 1159if (newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null) 1183if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1259ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward); 1320if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Forward)) 1368if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward)) 1602ExtendSelectionAndBringIntoView(lineRange.Start.CreatePointer(LogicalDirection.Forward), This); 1654if (TextPointerBase.IsNextToPlainLineBreak(destination, LogicalDirection.Forward) || 1655TextPointerBase.IsNextToRichLineBreak(destination, LogicalDirection.Forward)) 1664destination = destination.GetNextInsertionPosition(LogicalDirection.Forward); 1668else if (TextPointerBase.IsNextToParagraphBreak(destination, LogicalDirection.Forward) && 1669TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1673ITextPointer newDestination = destination.GetNextInsertionPosition(LogicalDirection.Forward); 1687destination = destination.GetFrozenPointer(LogicalDirection.Backward); 2036private static void MoveToCharacterLogicalDirection(TextEditor textEditor, LogicalDirection direction, bool extend) 2056ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2066LogicalDirection contentDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 2097private static void NavigateWordLogicalDirection(TextEditor textEditor, LogicalDirection direction) 2114if (direction == LogicalDirection.Forward) 2117if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2120textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2127TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Forward); 2129textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2137if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2140textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2147TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward); 2149textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2172private static void ExtendWordLogicalDirection(TextEditor textEditor, LogicalDirection direction) 2193wordBoundary.SetLogicalDirection(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward); 2305movingPosition.LogicalDirection == LogicalDirection.Backward && 2307TextPointerBase.IsNextToAnyBreak(movingPosition, LogicalDirection.Backward)) 2309movingPosition = movingPosition.GetNextInsertionPosition(LogicalDirection.Backward); 2313if (TextPointerBase.IsNextToPlainLineBreak(movingPosition, LogicalDirection.Backward)) 2315movingPosition = movingPosition.GetFrozenPointer(LogicalDirection.Forward); 2332return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2395ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2398This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2411ITextPointer cellEnd = position.GetNextInsertionPosition(LogicalDirection.Backward);
System\windows\Documents\TextEditorSpelling.cs (22)
35internal static SpellingError GetSpellingErrorAtPosition(TextEditor This, ITextPointer position, LogicalDirection direction) 58LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 66direction = (direction == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 81direction = (direction == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 86direction = LogicalDirection.Forward; 90direction = LogicalDirection.Backward; 100internal static ITextPointer GetNextSpellingErrorPosition(TextEditor This, ITextPointer position, LogicalDirection direction) 147caretPosition = textStart.CreatePointer(+correctedText.Length, LogicalDirection.Forward); 183textStart = spellingError.Start.CreatePointer(LogicalDirection.Backward); 185textStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 187textStart.MoveToNextContextPosition(LogicalDirection.Forward); 191textEnd.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text) 193textEnd.MoveToNextContextPosition(LogicalDirection.Backward); 196if (textStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text || 201Invariant.Assert(textEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 252private static ITextPointer GetNextTextPosition(ITextPointer position, ITextPointer limit, LogicalDirection direction, out char character) 315position = GetNextTextPosition(position, limit, LogicalDirection.Forward, out character);
System\windows\Documents\TextEditorTyping.cs (36)
533ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Forward); 556This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 610ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Backward); 635position = position.GetFrozenPointer(LogicalDirection.Backward); 642position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) 664This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 672else if (backspacePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text) 681This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 713This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 729LogicalDirection directionOfDelete = position.CompareTo(deletePosition) < 0 ? LogicalDirection.Forward : LogicalDirection.Backward; 736if (directionOfDelete == LogicalDirection.Forward) 763if (directionOfDelete == LogicalDirection.Backward) 800position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 801position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 806while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 813position = position.GetNextContextPosition(LogicalDirection.Backward); 814if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 822position = position.GetNextContextPosition(LogicalDirection.Backward); 833if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart) 839position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementEnd) 847while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 854if (!(navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 903TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Forward); 962TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward); 1071This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1162This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1331if (HandleTabInTables(This, LogicalDirection.Forward)) 1363if (HandleTabInTables(This, LogicalDirection.Backward)) 1384private static bool HandleTabInTables(TextEditor This, LogicalDirection direction) 1395This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1408if (direction == LogicalDirection.Forward) 1445if (direction == LogicalDirection.Forward) 1543ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1546This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
System\Windows\Documents\TextEffectResolver.cs (4)
100while (navigator.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text 101&& navigator.MoveToNextContextPosition(LogicalDirection.Forward)) ; 110while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text 112&& navigator.MoveToNextContextPosition(LogicalDirection.Forward)) ;
System\Windows\Documents\TextElement.cs (7)
287TextPointer contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward); 290TextPointer contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 313elementStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward); 346contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward); 379contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 420elementEnd = new TextPointer(tree, _textElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward); 993beforeStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
System\Windows\Documents\TextElementEnumerator.cs (3)
125_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 130Invariant.Assert(_navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, 134_navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\TextFindEngine.cs (17)
183LogicalDirection direction; 192direction = LogicalDirection.Backward; 197direction = LogicalDirection.Forward; 302hasPreceedingSeparatorChar = HasNeighboringSeparatorChar(oppositeEndPosition, LogicalDirection.Backward); 303hasFollowingSeparatorChar = HasNeighboringSeparatorChar(position, LogicalDirection.Forward); 307hasPreceedingSeparatorChar = HasNeighboringSeparatorChar(position, LogicalDirection.Backward); 308hasFollowingSeparatorChar = HasNeighboringSeparatorChar(oppositeEndPosition, LogicalDirection.Forward); 314private static bool HasNeighboringSeparatorChar(ITextPointer position, LogicalDirection direction) 339LogicalDirection.Forward, 351if (direction == LogicalDirection.Forward) 636LogicalDirection direction, 886private static bool IsAdjacentToFormatElement(ITextPointer pointer, LogicalDirection direction) 893if (direction == LogicalDirection.Forward) 895context = pointer.GetPointerContext(LogicalDirection.Forward); 898TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Forward))) 910context = pointer.GetPointerContext(LogicalDirection.Backward); 913TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Backward)))
System\Windows\Documents\TextMapOffsetErrorLogger.cs (2)
57public TextMapOffsetErrorLogger(LogicalDirection direction, TextMap textMap, ArrayList segments, int positionInSegmentList, int leftWordBreak, int rightWordBreak, int contentOffset) 144/// string representation of a <see cref="LogicalDirection"/> instance.
System\Windows\Documents\TextParentUndoUnit.cs (4)
200private readonly LogicalDirection _undoAnchorPositionDirection; 203private readonly LogicalDirection _undoMovingPositionDirection; 206private LogicalDirection _redoAnchorPositionDirection; 209private LogicalDirection _redoMovingPositionDirection;
System\Windows\Documents\TextPointer.cs (97)
270internal TextPointer(TextPointer position, LogicalDirection direction) 276internal TextPointer(TextPointer position, int offset, LogicalDirection direction) 282internal TextPointer(TextContainer textContainer, int offset, LogicalDirection direction) 300Initialize(tree, node, edge, LogicalDirection.Forward, tree.PositionGeneration, false, false, tree.LayoutGeneration); 304internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection direction) 316internal TextPointer CreatePointer(LogicalDirection gravity) 495/// is <see cref="System.Windows.Documents.LogicalDirection.Backward"/>, or if it is positioned 497/// <see cref="System.Windows.Documents.LogicalDirection.Forward"/>.</para> 538public TextPointerContext GetPointerContext(LogicalDirection direction) 546return (direction == LogicalDirection.Forward) ? GetPointerContextForward(_node, this.Edge) : GetPointerContextBackward(_node, this.Edge); 560public int GetTextRunLength(LogicalDirection direction) 581if (direction == LogicalDirection.Forward) 597textNode = ((direction == LogicalDirection.Forward) ? textNode.GetNextNode() : textNode.GetPreviousNode()) as TextTreeTextNode; 731public string GetTextInRun(LogicalDirection direction) 769public int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 803public DependencyObject GetAdjacentElement(LogicalDirection direction) 896public TextPointer GetPositionAtOffset(int offset, LogicalDirection direction) 984public TextPointer GetNextContextPosition(LogicalDirection direction) 1057public TextPointer GetInsertionPosition(LogicalDirection direction) 1065return GetInsertionPosition(LogicalDirection.Forward); 1084/// "insertion position" in the <see cref="TextPointer.GetInsertionPosition(LogicalDirection)"/> 1124public TextPointer GetNextInsertionPosition(LogicalDirection direction) 1221position.SetLogicalDirection(LogicalDirection.Forward); 1242public Rect GetCharacterRect(LogicalDirection direction) 1324LogicalDirection direction = count < 0 ? LogicalDirection.Backward : LogicalDirection.Forward; 1529public LogicalDirection LogicalDirection 1609TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1613TextSchema.IsFormattingType(position.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1615position.MoveToNextContextPosition(LogicalDirection.Backward); 1616backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1744internal static int GetTextInRun(TextContainer textContainer, int symbolOffset, TextTreeTextNode textNode, int nodeOffset, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 1776skipCount = (direction == LogicalDirection.Forward) ? nodeOffset : textNode.SymbolCount - nodeOffset; 1793textNode = ((direction == LogicalDirection.Forward) ? textNode.GetNextNode() : textNode.GetPreviousNode()) as TextTreeTextNode; 1797if (direction == LogicalDirection.Backward) 1810internal static DependencyObject GetAdjacentElement(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 1966internal bool MoveToNextContextPosition(LogicalDirection direction) 1979if (direction == LogicalDirection.Forward) 2026internal bool MoveToInsertionPosition(LogicalDirection direction) 2069internal bool MoveToNextInsertionPosition(LogicalDirection direction) 2162internal TextElement GetAdjacentElementFromOuterPosition(LogicalDirection direction) 2180internal void SetLogicalDirection(LogicalDirection direction) 2333internal TextPointer GetFrozenPointer(LogicalDirection logicalDirection) 2342void ITextPointer.SetLogicalDirection(LogicalDirection direction) 2382TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 2387int ITextPointer.GetTextRunLength(LogicalDirection direction) 2393string ITextPointer.GetTextInRun(LogicalDirection direction) 2398int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 2403object ITextPointer.GetAdjacentElement(LogicalDirection direction) 2408Type ITextPointer.GetElementType(LogicalDirection direction) 2445ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 2460ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 2471ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 2480ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 2574ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 2579ITextPointer ITextPointer.CreatePointer(int offset, LogicalDirection gravity) 2590ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 2596bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 2653Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 2658bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 2663bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 2673internal bool MoveToCaretPosition(LogicalDirection contentDirection) 2676LogicalDirection oppositeDirection; 2697oppositeDirection = (contentDirection == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 2708internal bool MoveToNextCaretPosition(LogicalDirection direction) 2809internal TextTreeTextNode GetAdjacentTextNodeSibling(LogicalDirection direction) 2816internal static TextTreeTextNode GetAdjacentTextNodeSibling(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 2823internal TextTreeTextElementNode GetAdjacentTextElementNodeSibling(LogicalDirection direction) 2830internal TextTreeTextElementNode GetAdjacentTextElementNode(LogicalDirection direction) 2837internal TextTreeNode GetAdjacentSiblingNode(LogicalDirection direction) 2844internal static TextTreeNode GetAdjacentSiblingNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 2848if (direction == LogicalDirection.Forward) 3004if (GetGravityInternal() == LogicalDirection.Forward) 3435symbolType = node.GetPointerContext(LogicalDirection.Forward); 3442symbolType = firstContainedNode.GetPointerContext(LogicalDirection.Forward); 3460symbolType = nextNode.GetPointerContext(LogicalDirection.Forward); 3492symbolType = previousNode.GetPointerContext(LogicalDirection.Backward); 3512symbolType = lastChildNode.GetPointerContext(LogicalDirection.Backward); 3521symbolType = node.GetPointerContext(LogicalDirection.Backward); 3672LogicalDirection ITextPointer.LogicalDirection 3887private void InitializeOffset(TextPointer position, int distance, LogicalDirection direction) 3924private void Initialize(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection gravity, uint generation, 3984private static void RepositionForGravity(ref TextTreeNode node, ref ElementEdge edge, LogicalDirection gravity) 3995if (gravity == LogicalDirection.Backward) 4008if (gravity == LogicalDirection.Forward) 4021if (gravity == LogicalDirection.Backward) 4034if (gravity == LogicalDirection.Forward) 4052private LogicalDirection GetGravityInternal() 4054return (this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd) ? LogicalDirection.Forward : LogicalDirection.Backward; 4067internal TextTreeNode GetAdjacentNode(LogicalDirection direction) 4072internal static TextTreeNode GetAdjacentNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 4116private TextElement GetElement(LogicalDirection direction) 4135if (GetGravityInternal() == LogicalDirection.Forward)
System\Windows\Documents\TextPointerBase.cs (111)
55internal static string GetTextInRun(ITextPointer position, LogicalDirection direction) 73internal static int GetTextWithLimit(ITextPointer thisPointer, LogicalDirection direction, char[] textBuffer, int startIndex, int count, ITextPointer limit) 82else if (direction == LogicalDirection.Forward && limit.CompareTo(thisPointer) <= 0) 87else if (direction == LogicalDirection.Backward && limit.CompareTo(thisPointer) >= 0) 99if (direction == LogicalDirection.Forward) 181Type forwardType = forwardPosition.GetElementType(LogicalDirection.Forward); 182Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward); 185TextPointerContext forwardContext = forwardPosition.GetPointerContext(LogicalDirection.Forward); 186TextPointerContext backwardContext = backwardPosition.GetPointerContext(LogicalDirection.Backward); 227TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 228TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 251TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 252TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 256typeof(Table).IsAssignableFrom(position.GetElementType(LogicalDirection.Forward))); 269position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 275position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd; 320BorderingElementCategory category = GetBorderingElementCategory(navigator, LogicalDirection.Forward); 327navigator.MoveToNextContextPosition(LogicalDirection.Forward); 329while (GetBorderingElementCategory(navigator, LogicalDirection.Forward) == BorderingElementCategory.MergeableScopingInline); 335elementType = navigator.GetElementType(LogicalDirection.Forward); 339navigator.MoveToNextContextPosition(LogicalDirection.Forward); 356elementType = navigator.GetElementType(LogicalDirection.Forward); 359navigator.MoveToNextInsertionPosition(LogicalDirection.Forward); 372navigator.MoveToNextContextPosition(LogicalDirection.Forward); 374while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 385return IsAtNonMergeableInlineEdge(position, LogicalDirection.Backward); 391return IsAtNonMergeableInlineEdge(position, LogicalDirection.Forward); 401internal static bool IsAtFormatNormalizedPosition(ITextPointer position, LogicalDirection direction) 406internal static bool IsAtInsertionPosition(ITextPointer position, LogicalDirection direction) 411internal static bool IsAtNormalizedPosition(ITextPointer position, LogicalDirection direction, bool respectCaretUnitBoundaries) 420if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 421position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 466internal static bool IsAtWordBoundary(ITextPointer thisPosition, LogicalDirection insideWordDirection) 509return GetWordRange(thisPosition, LogicalDirection.Forward); 521internal static TextSegment GetWordRange(ITextPointer thisPosition, LogicalDirection direction) 544if (moved && IsAtWordBoundary(thisPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 551MoveToNextWordBoundary(navigator, direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 555if (direction == LogicalDirection.Backward) 564wordStart = RestrictWithinBlock(thisPosition, wordStart, LogicalDirection.Backward); 565wordEnd = RestrictWithinBlock(thisPosition, wordEnd, LogicalDirection.Forward); 570wordStart = wordStart.GetFrozenPointer(LogicalDirection.Backward); 571wordEnd = wordEnd.GetFrozenPointer(LogicalDirection.Forward); 575wordStart = wordEnd.GetFrozenPointer(LogicalDirection.Backward); 583private static ITextPointer RestrictWithinBlock(ITextPointer position, ITextPointer limit, LogicalDirection direction) 585Invariant.Assert(!(direction == LogicalDirection.Backward) || position.CompareTo(limit) >= 0, "for backward direction position must be >= than limit"); 586Invariant.Assert(!(direction == LogicalDirection.Forward) || position.CompareTo(limit) <= 0, "for forward direcion position must be <= than linit"); 588while (direction == LogicalDirection.Backward ? position.CompareTo(limit) > 0 : position.CompareTo(limit) < 0) 609return limit.GetInsertionPosition(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 618internal static bool IsNextToPlainLineBreak(ITextPointer thisPosition, LogicalDirection direction) 628(direction == LogicalDirection.Backward && IsCharUnicodeNewLine(textBuffer[1])) 630(direction == LogicalDirection.Forward && IsCharUnicodeNewLine(textBuffer[0])) 646internal static bool IsNextToRichLineBreak(ITextPointer thisPosition, LogicalDirection direction) 655internal static bool IsNextToParagraphBreak(ITextPointer thisPosition, LogicalDirection direction) 666internal static bool IsNextToAnyBreak(ITextPointer thisPosition, LogicalDirection direction) 696bool isAtLineWrappingPosition = position.LogicalDirection == LogicalDirection.Forward 711thisPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 712thisPosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart; 722return thisPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.None && 723thisPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 724!typeof(Inline).IsAssignableFrom(thisPosition.GetElementType(LogicalDirection.Backward)); 738while (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 744pointer = pointer.GetNextContextPosition(LogicalDirection.Backward); 776paragraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 853internal static Rect GetCharacterRect(ITextPointer thisPointer, LogicalDirection direction) 859internal static Rect GetCharacterRect(ITextPointer thisPointer, LogicalDirection direction, bool transformToUiScope) 920internal static bool MoveToFormatNormalizedPosition(ITextPointer thisNavigator, LogicalDirection direction) 933internal static bool MoveToInsertionPosition(ITextPointer thisNavigator, LogicalDirection direction) 956internal static bool MoveToNextInsertionPosition(ITextPointer thisNavigator, LogicalDirection direction) 962int increment = direction == LogicalDirection.Forward ? +1 : -1; 979if ((direction == LogicalDirection.Forward && initialPosition.CompareTo(thisNavigator) < 0) || 980(direction == LogicalDirection.Backward && thisNavigator.CompareTo(initialPosition) < 0)) 1010if (direction == LogicalDirection.Backward) 1023while (TextSchema.IsFormattingType(thisNavigator.GetElementType(LogicalDirection.Forward)) 1034if (direction == LogicalDirection.Forward) 1064internal static bool MoveToNextWordBoundary(ITextPointer thisNavigator, LogicalDirection movingDirection) 1085if (IsAtWordBoundary(thisNavigator, /*insideWordDirection:*/LogicalDirection.Forward)) 1096internal static ITextPointer GetFrozenPointer(ITextPointer thisPointer, LogicalDirection logicalDirection) 1135private static bool NormalizePosition(ITextPointer thisNavigator, LogicalDirection direction, bool respectCaretUnitBoundaries) 1141LogicalDirection oppositeDirection; 1145if (direction == LogicalDirection.Forward) 1148oppositeDirection = LogicalDirection.Backward; 1155oppositeDirection = LogicalDirection.Forward; 1251private static int LeaveNonMergeableInlineBoundary(ITextPointer thisNavigator, LogicalDirection direction, int symbolCount) 1255if (direction == LogicalDirection.Forward && IsAtNonMergeableInlineEnd(thisNavigator)) 1257symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Forward); 1261symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward); 1266if (direction == LogicalDirection.Backward && IsAtNonMergeableInlineStart(thisNavigator)) 1268symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward); 1272symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Forward); 1280private static int LeaveNonMergeableAncestor(ITextPointer thisNavigator, LogicalDirection direction) 1283int increment = (direction == LogicalDirection.Forward) ? +1 : -1; 1328TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 1329TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1364if (position.GetTextInRun(LogicalDirection.Backward, neighborhood, 0, 1) == 1 && 1365position.GetTextInRun(LogicalDirection.Forward, neighborhood, 1, 1) == 1) 1423runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount); 1427navigator.GetTextInRun(LogicalDirection.Forward, preceedingText, SelectionWordBreaker.MinContextLength - preceedingCount, runLength); 1433navigator.MoveToInsertionPosition(LogicalDirection.Backward); 1435while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text); 1442runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Forward), SelectionWordBreaker.MinContextLength - followingCount); 1444navigator.GetTextInRun(LogicalDirection.Forward, followingText, followingCount, runLength); 1453navigator.MoveToInsertionPosition(LogicalDirection.Forward); 1455while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 1466private static bool IsAtNonMergeableInlineEdge(ITextPointer position, LogicalDirection direction) 1486private static BorderingElementCategory GetBorderingElementCategory(ITextPointer position, LogicalDirection direction) 1488TextPointerContext context = (direction == LogicalDirection.Forward) ? TextPointerContext.ElementEnd : TextPointerContext.ElementStart; 1512private static bool IsNextToRichBreak(ITextPointer thisPosition, LogicalDirection direction, Type lineBreakType)
System\Windows\Documents\TextRangeBase.cs (68)
73textPointer = textPointer.GetFormatNormalizedPosition(LogicalDirection.Forward); 77textPointer = textPointer.GetFormatNormalizedPosition(LogicalDirection.Backward); 191normalizedPosition.MoveToInsertionPosition(LogicalDirection.Backward); 206!TextPointerBase.IsAtWordBoundary(thisRange.Start, LogicalDirection.Forward) && // 207!TextPointerBase.IsAtWordBoundary(thisRange.Start, LogicalDirection.Backward)) 282!TextPointerBase.IsNextToAnyBreak(thisRange.End, LogicalDirection.Forward)) 288nextPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 301(TextPointerBase.IsNextToAnyBreak(thisRange.End, LogicalDirection.Backward) || 304ITextPointer newEnd = thisRange.End.GetNextInsertionPosition(LogicalDirection.Backward); 332SkipParagraphContent(start, LogicalDirection.Backward); 333SkipParagraphContent(end, LogicalDirection.Forward); 340private static void SkipParagraphContent(ITextPointer navigator, LogicalDirection direction) 349(nextContext == TextPointerContext.ElementStart && direction == LogicalDirection.Forward || // 350nextContext == TextPointerContext.ElementEnd && direction == LogicalDirection.Backward) && // 354(nextContext == TextPointerContext.ElementEnd && direction == LogicalDirection.Forward || // 355nextContext == TextPointerContext.ElementStart && direction == LogicalDirection.Backward) && // 410if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 412moved = position.MoveToNextContextPosition(LogicalDirection.Forward); 416moved = position.MoveToInsertionPosition(LogicalDirection.Forward); 421moved = position.MoveToNextInsertionPosition(LogicalDirection.Forward); 471position.MoveToNextContextPosition(LogicalDirection.Backward)) ; 492moved = position.MoveToNextContextPosition(LogicalDirection.Forward); 515endNavigator.MoveToInsertionPosition(LogicalDirection.Backward); 677TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 693navigator.MoveToNextContextPosition(LogicalDirection.Forward); 703navigator.MoveToNextContextPosition(LogicalDirection.Forward); 708navigator.MoveToNextContextPosition(LogicalDirection.Forward); 711elementType = navigator.GetElementType(LogicalDirection.Forward); 731navigator.MoveToNextContextPosition(LogicalDirection.Forward); 747int runLength = navigator.GetTextRunLength(LogicalDirection.Forward); 749runLength = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, charArray, 0, runLength, endPosition); 751navigator.MoveToNextContextPosition(LogicalDirection.Forward); 761bool theParagraphIsTheFirstInCollection = navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 762navigator.MoveToNextContextPosition(LogicalDirection.Forward); 764TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 771navigator.MoveToNextContextPosition(LogicalDirection.Forward); 772symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 795List list = (List)navigator.GetAdjacentElement(LogicalDirection.Forward); 816navigator.MoveToNextContextPosition(LogicalDirection.Forward); 826ListItem listItem = (ListItem)navigator.GetAdjacentElement(LogicalDirection.Forward); 858object element = navigator.GetAdjacentElement(LogicalDirection.Forward); 1250while (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1254start = start.GetNextContextPosition(LogicalDirection.Backward); 1310if (thisRange.Start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 1311thisRange.End.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 1357(insertPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.None || 1358insertPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) && 1359(insertPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.None || 1360insertPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd); 1371ITextPointer newStart = insertPosition.GetFrozenPointer(LogicalDirection.Backward); 1372ITextPointer newEnd = insertPosition.CreatePointer(LogicalDirection.Forward); 1377TextPointer insertionPosition = (TextPointer)newStart.CreatePointer(LogicalDirection.Forward); 1415newEnd = newEnd.GetNextInsertionPosition(LogicalDirection.Forward); 1616TextPointerContext context = start.GetPointerContext(LogicalDirection.Forward); 1619start.MoveToNextContextPosition(LogicalDirection.Forward); 1620context = start.GetPointerContext(LogicalDirection.Forward); 1625context = end.GetPointerContext(LogicalDirection.Backward); 1628end.MoveToNextContextPosition(LogicalDirection.Backward); 1629context = end.GetPointerContext(LogicalDirection.Backward); 1633return start.GetAdjacentElement(LogicalDirection.Forward) as UIElement; 1714start = GetNormalizedPosition(thisRange, start, LogicalDirection.Forward); 1721end = GetNormalizedPosition(thisRange, end, LogicalDirection.Backward); 1728if (start.LogicalDirection == LogicalDirection.Backward) 1731start = end.GetFrozenPointer(LogicalDirection.Backward); 1782private static bool IsAtNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction) 1798private static ITextPointer GetNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction) 1956!TextPointerBase.IsAtInsertionPosition(start, LogicalDirection.Forward) || 1957!TextPointerBase.IsAtInsertionPosition(end, LogicalDirection.Backward))
System\Windows\Documents\TextRangeEdit.cs (76)
65if (!keepEmptyFormatting && splitPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 71else if (!keepEmptyFormatting && splitPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 262while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 267while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 277position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 278position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 279(firstInline = position.GetAdjacentElement(LogicalDirection.Backward) as Inline) != null && 280(secondInline = position.GetAdjacentElement(LogicalDirection.Forward) as Inline) != null) 329inline.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 330inline.ElementEnd.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 416if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 457start = start.GetNextContextPosition(LogicalDirection.Forward); 531if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 538else if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 554Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd, "position must be after ElementEnd"); 555Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "position must be before ElementStart"); 655while (!(breakPosition.Parent is Paragraph) && breakPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 657breakPosition = breakPosition.GetNextContextPosition(LogicalDirection.Forward); 661breakPosition = breakPosition.GetInsertionPosition(LogicalDirection.Forward); 698return lineBreak.ElementEnd.GetInsertionPosition(LogicalDirection.Forward); 797start = block.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 804TextPointer contentStart = block.ContentStart.GetPositionAtOffset(0, LogicalDirection.Forward); // Normalize forward; 805contentStart = contentStart.GetNextContextPosition(LogicalDirection.Forward); // Leave scope of initial List. 825start = block.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 966TextPointer start = firstChild.ElementStart.GetFrozenPointer(LogicalDirection.Backward); 967TextPointer end = lastChild.ElementEnd.GetFrozenPointer(LogicalDirection.Forward); 974firstChild = (Inline)start.GetAdjacentElement(LogicalDirection.Forward); 975lastChild = (Inline)end.GetAdjacentElement(LogicalDirection.Backward); 1030if (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 1048pointer = pointer.GetNextContextPosition(LogicalDirection.Forward); 1247if (rangeStart.CompareTo(rangeEnd) < 0 && rangeEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 1249rangeEnd = rangeEnd.GetNextInsertionPosition(LogicalDirection.Backward); 1257rangeEnd = rangeEnd.GetInsertionPosition(LogicalDirection.Backward); 1266TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1267TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 1277while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1282while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 1297while (previousPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 1298TextSchema.IsMergeableInline(previousPosition.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1300previousPosition = ((Inline)previousPosition.GetAdjacentElement(LogicalDirection.Backward)).ContentEnd; 1306while (nextPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 1307TextSchema.IsMergeableInline(nextPosition.GetAdjacentElement(LogicalDirection.Forward).GetType())) 1309nextPosition = ((Inline)nextPosition.GetAdjacentElement(LogicalDirection.Forward)).ContentStart; 1438while (startPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1439startPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 1577LogicalDirection direction; 1578LogicalDirection oppositeDirection; 1585direction = LogicalDirection.Forward; 1586oppositeDirection = LogicalDirection.Backward; 1594direction = LogicalDirection.Backward; 1595oppositeDirection = LogicalDirection.Forward; 1612Invariant.Assert(direction == LogicalDirection.Forward && nextPosition.CompareTo(end) < 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) > 0, 1624if (direction == LogicalDirection.Forward && nextPosition.CompareTo(end) > 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) < 0) 1638if (direction == LogicalDirection.Forward && nextPosition.CompareTo(end) >= 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) <= 0) 1892TextPointer nextRunPosition = run.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 1900nextRunPosition = nextRunPosition.GetNextContextPosition(LogicalDirection.Forward); 2052Span parent = (Span)end.GetAdjacentElement(LogicalDirection.Backward); 2082if (pointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 2083(run = pointer.GetAdjacentElement(LogicalDirection.Forward) as Run) != null) 2097pointer = pointer.GetNextContextPosition(LogicalDirection.Forward); 2109start = start.GetPositionAtOffset(0, LogicalDirection.Forward); 2113start = start.GetNextContextPosition(LogicalDirection.Forward); 2117if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2127start = start.GetNextContextPosition(LogicalDirection.Forward); 2148run = (Run)start.GetAdjacentElement(LogicalDirection.Forward); 2161DependencyObject forwardElement = start.GetAdjacentElement(LogicalDirection.Forward); 2162DependencyObject backwardElement = end.GetAdjacentElement(LogicalDirection.Backward); 2167Inline inline = (Inline)start.GetAdjacentElement(LogicalDirection.Forward); 2186start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2187end.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 2188start.GetAdjacentElement(LogicalDirection.Backward) == commonAncestor) 2233if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2245start = start.GetNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\TextRangeEditLists.cs (27)
75while (secondParagraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 94TextPointer positionAfterSecondParagraph = secondParagraphOrBlockUIContainer.ElementEnd.GetFrozenPointer(LogicalDirection.Forward); 99TextElement previousBlock = secondParagraphOrBlockUIContainer.ElementStart.GetAdjacentElement(LogicalDirection.Backward) as TextElement; 143ListItem followingListItem = positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart 144? positionAfterSecondParagraph.GetAdjacentElement(LogicalDirection.Forward) as ListItem : null; 147ListItem precedingListItem = positionAfterSecondParagraph.GetAdjacentElement(LogicalDirection.Backward) as ListItem; 151Invariant.Assert(positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 152Invariant.Assert(positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd); 173while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 175navigator.MoveToNextContextPosition(LogicalDirection.Forward); 185while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 187navigator.MoveToNextContextPosition(LogicalDirection.Backward); 208if (mergePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementEnd || 209mergePosition.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementStart) 214List precedingList = mergePosition.GetAdjacentElement(LogicalDirection.Backward) as List; 215List followingList = mergePosition.GetAdjacentElement(LogicalDirection.Forward) as List; 307Block nextBlock = block == lastBlock ? null : block.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as Block; 373ListItem nextListItem = listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as ListItem; 559ListItem nextListItem = listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as ListItem; 606while (end.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 612end = end.GetNextContextPosition(LogicalDirection.Forward); 635while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 642position = position.GetNextContextPosition(LogicalDirection.Forward); 646while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 655position = position.GetNextContextPosition(LogicalDirection.Forward); 763TextPointer adjustedEnd = list.ElementEnd.GetInsertionPosition(LogicalDirection.Backward); 766adjustedEnd = adjustedEnd.GetNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Documents\TextRangeEditTables.cs (35)
66TextPointer lastCellPointer = (TextPointer)range.TextSegments[0].End.GetNextInsertionPosition(LogicalDirection.Backward); 427internal static TextPointer GetNextTableCellRangeInsertionPosition(TextSelection selection, LogicalDirection direction) 448if (direction == LogicalDirection.Backward && movingCell == anchorCell) 453else if (direction == LogicalDirection.Forward && 466if (direction == LogicalDirection.Forward) 527movingPosition = movingCell.ContentEnd.GetInsertionPosition().GetNextInsertionPosition(LogicalDirection.Forward); 537if (direction == LogicalDirection.Forward) 557internal static TextPointer GetNextRowEndMovingPosition(TextSelection selection, LogicalDirection direction) 566return (direction == LogicalDirection.Forward) ? row.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward) : 567row.ContentStart.GetNextInsertionPosition(LogicalDirection.Backward); 586internal static TextPointer GetNextRowStartMovingPosition(TextSelection selection, LogicalDirection direction) 598return (direction == LogicalDirection.Forward) ? row.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward) : 599row.ContentStart.GetNextInsertionPosition(LogicalDirection.Backward); 749bool insertBefore = position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 787nextInsertionPosition = nextInsertionPosition.GetNextInsertionPosition(LogicalDirection.Forward); 812while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 814position = position.GetNextContextPosition(LogicalDirection.Forward); 816while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd) 818position = position.GetNextContextPosition(LogicalDirection.Backward); 893if (position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is Run) 896insertionPosition.MoveToNextContextPosition(LogicalDirection.Forward); 899else if (position.GetAdjacentElementFromOuterPosition(LogicalDirection.Backward) is Run) 902insertionPosition.MoveToNextContextPosition(LogicalDirection.Backward); 1078TextPointer end = ((TextPointer)textSegment.End).GetNextInsertionPosition(LogicalDirection.Backward); 1086cellEnd.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1088cell = (TableCell)cellEnd.GetAdjacentElement(LogicalDirection.Forward); 1963startPosition = startPosition.GetInsertionPosition(LogicalDirection.Forward); 1966endPosition = endPosition.GetInsertionPosition(LogicalDirection.Backward); 1991TextPointer start = startCell.ContentStart.GetInsertionPosition(LogicalDirection.Forward); 1995TextPointer end = endCell.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward); 2052anchorPosition = anchorPosition.GetInsertionPosition(LogicalDirection.Forward); 2055movingPosition = movingPosition.GetInsertionPosition(LogicalDirection.Backward); 2093movingPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
System\Windows\Documents\TextRangeSerialization.cs (54)
75range.End.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart; 204while (rangeEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 206rangeEnd = rangeEnd.GetNextContextPosition(LogicalDirection.Backward); 212TextPointerContext runType = textReader.GetPointerContext(LogicalDirection.Forward); 217TextElement nextElement = (TextElement)textReader.GetAdjacentElement(LogicalDirection.Forward); 226textReader.MoveToNextContextPosition(LogicalDirection.Forward); 246textReader.MoveToNextContextPosition(LogicalDirection.Forward); 254textReader.MoveToNextContextPosition(LogicalDirection.Forward); 264if (ignoreWriteHyperlinkEnd && (textReader.GetAdjacentElement(LogicalDirection.Forward) is Hyperlink)) 268textReader.MoveToNextContextPosition(LogicalDirection.Forward); 281textReader.MoveToNextContextPosition(LogicalDirection.Forward); 298textReader.MoveToNextContextPosition(LogicalDirection.Forward); 302int textLength = textReader.GetTextRunLength(LogicalDirection.Forward); 305textLength = TextPointerBase.GetTextWithLimit(textReader, LogicalDirection.Forward, text, 0, textLength, rangeEnd); 312textReader.MoveToNextContextPosition(LogicalDirection.Forward); 316object embeddedObject = textReader.GetAdjacentElement(LogicalDirection.Forward); 317textReader.MoveToNextContextPosition(LogicalDirection.Forward); 324textReader.MoveToNextContextPosition(LogicalDirection.Forward); 545InlineUIContainer inlineUIContainer = textReader.GetAdjacentElement(LogicalDirection.Backward) as InlineUIContainer; 546BlockUIContainer blockUIContainer = textReader.GetAdjacentElement(LogicalDirection.Backward) as BlockUIContainer; 1225TextElement uiContainer = fragment.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 1331fragmentEnd = fragment.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); // need forward orientation to stick with the following content during merge at fragmentStart position 1359fragmentEnd = fragmentEnd.GetInsertionPosition(LogicalDirection.Forward); 1413while (positionBeforeParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1416positionBeforeParagraph = positionBeforeParagraph.GetNextContextPosition(LogicalDirection.Backward); 1418while (positionBeforeParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1422positionBeforeParagraph = positionBeforeParagraph.GetNextContextPosition(LogicalDirection.Backward); 1456if (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd) 1458navigator = navigator.GetNextContextPosition(LogicalDirection.Backward); 1474if (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1476navigator = navigator.GetNextContextPosition(LogicalDirection.Forward); 1511TextPointerContext forwardFromStart = start.GetPointerContext(LogicalDirection.Forward); 1512TextPointerContext backwardFromEnd = end.GetPointerContext(LogicalDirection.Backward); 1515Invariant.Assert(itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1517Invariant.Assert(itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1521TextPointerContext backwardFromStart = start.GetPointerContext(LogicalDirection.Backward); 1522TextPointerContext forwardFromEnd = end.GetPointerContext(LogicalDirection.Forward); 1524Invariant.Assert(!(backwardFromStart == TextPointerContext.ElementEnd) || itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1527Invariant.Assert(!(forwardFromEnd == TextPointerContext.ElementStart) || itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1549((Section)fragment).HasTrailingParagraphBreakOnPaste = range.End.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None; 1605start = start.GetNextContextPosition(LogicalDirection.Forward); 1609TextPointerContext passedContext = start.GetPointerContext(LogicalDirection.Backward); 1649start = start.GetNextContextPosition(LogicalDirection.Forward); 1656start = start.GetNextContextPosition(LogicalDirection.Forward); 1846Invariant.Assert(textReader.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 1851elementEnd.MoveToNextContextPosition(LogicalDirection.Forward); 1873Invariant.Assert(textReader.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 1874Invariant.Assert(typeof(Hyperlink).IsAssignableFrom(textReader.GetElementType(LogicalDirection.Forward))); 1879Hyperlink hyperlink = (Hyperlink)textReader.GetAdjacentElement(LogicalDirection.Forward); 1884hyperlinkEnd.MoveToNextContextPosition(LogicalDirection.Forward); 1899InlineUIContainer inlineUIContainer = hyperlinkNavigation.GetAdjacentElement(LogicalDirection.Forward) as InlineUIContainer; 1906hyperlinkNavigation.MoveToNextContextPosition(LogicalDirection.Forward); 1921hyperlinkStart = range.Start.CreatePointer(LogicalDirection.Forward); 1922while (hyperlinkStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
System\Windows\Documents\TextSchema.cs (5)
161TextElement leftElement = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Backward); 162TextElement rightElement = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 887TextPointerContext forwardContext = start.GetPointerContext(LogicalDirection.Forward); 890TextElement nextElement = (TextElement)start.GetAdjacentElement(LogicalDirection.Forward); 903start = start.GetNextContextPosition(LogicalDirection.Forward);
System\windows\Documents\TextSegment.cs (2)
74_start = startPosition.GetFrozenPointer(preserveLogicalDirection ? startPosition.LogicalDirection : LogicalDirection.Backward); 75_end = endPosition.GetFrozenPointer(preserveLogicalDirection ? endPosition.LogicalDirection : LogicalDirection.Forward);
System\windows\Documents\TextSelection.cs (64)
287((ITextSelection)this).SetCaretToPosition(((ITextRange)this).End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 438void ITextSelection.SetCaretToPosition(ITextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace) 453ITextPointer reversePosition = caretPosition.CreatePointer(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward); 459TextPointerBase.IsNextToPlainLineBreak(caretPosition, LogicalDirection.Backward) || 460TextSchema.IsBreak(caretPosition.GetElementType(LogicalDirection.Backward)))) 464caretPosition.SetLogicalDirection(LogicalDirection.Forward); 468if (caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 469caretPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 491LogicalDirection oppositeDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 568bool ITextSelection.ExtendToNextInsertionPosition(LogicalDirection direction) 603if (newMovingPosition == null && direction == LogicalDirection.Forward) 623LogicalDirection contentDirection = (anchorPosition.CompareTo(newMovingPosition) <= 0) ? 624LogicalDirection.Backward : LogicalDirection.Forward; 640private ITextPointer GetNextTextSegmentInsertionPosition(LogicalDirection direction) 824startPosition = anchorWordRange.Start.GetFrozenPointer(LogicalDirection.Forward); 825movingPosition = cursorWordRange.End.GetFrozenPointer(LogicalDirection.Backward); 829startPosition = anchorWordRange.End.GetFrozenPointer(LogicalDirection.Backward); 830movingPosition = cursorWordRange.Start.GetFrozenPointer(LogicalDirection.Forward); 946anchorWordRange.Contains(cursorPosition.GetInsertionPosition(LogicalDirection.Forward)) || 947anchorWordRange.Contains(cursorPosition.GetInsertionPosition(LogicalDirection.Backward))) 959TextPointerBase.IsAtWordBoundary(anchorPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 973TextPointerBase.IsAtWordBoundary(cursorPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 1008bool ITextSelection.ExtendToNextTableRow(LogicalDirection direction) 1036if (direction == LogicalDirection.Forward) 1065movingPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 1165internal void SetCaretToPosition(TextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace) 1173internal bool ExtendToNextInsertionPosition(LogicalDirection direction) 1370this.SetCaretToPosition(cellStart, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1534Invariant.Assert(this.Start.LogicalDirection == LogicalDirection.Backward); 1535Invariant.Assert(this.End.LogicalDirection == LogicalDirection.Forward); 1740return (This.Start.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 1741This.End.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text && 1742This.Start.GetNextInsertionPosition(LogicalDirection.Backward) == null && 1743This.End.GetNextInsertionPosition(LogicalDirection.Forward) == null); 1978(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X < cursorMousePoint.X || 1979cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X < objectEdgeRect.X)) 1984(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X > cursorMousePoint.X || 1985cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X > objectEdgeRect.X)) 1993(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X > cursorMousePoint.X || 1994cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X > objectEdgeRect.X)) 1999(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X < cursorMousePoint.X || 2000cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X < objectEdgeRect.X)) 2162if ((caretPosition.LogicalDirection == LogicalDirection.Backward && // 2163caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) || // 2170caretPosition.MoveToNextInsertionPosition(LogicalDirection.Backward); 2171caretPosition.SetLogicalDirection(LogicalDirection.Forward); 2179if (caretPosition.LogicalDirection == LogicalDirection.Backward && // 2180caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && // 2181(caretPosition.GetNextInsertionPosition(LogicalDirection.Backward) == null || // 2182TextPointerBase.IsNextToAnyBreak(caretPosition, LogicalDirection.Backward))) 2185caretPosition.SetLogicalDirection(LogicalDirection.Forward); 2259nextCharacterPosition = focusedTextSelection.Start.CreatePointer(LogicalDirection.Forward); 2264nextCharacterPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 2265nextCharacterPosition.SetLogicalDirection(LogicalDirection.Backward); 2273nextCharacterPosition = focusedTextSelection.End.CreatePointer(LogicalDirection.Backward); 2278nextCharacterPosition.MoveToNextInsertionPosition(LogicalDirection.Backward); 2279nextCharacterPosition.SetLogicalDirection(LogicalDirection.Forward); 2741private LogicalDirection _movingPositionDirection;
System\windows\Documents\TextSelectionHighlightLayer.cs (6)
54internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 71internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 89if ((direction == LogicalDirection.Forward && textSegment.Start.CompareTo(textPosition) <= 0 && textPosition.CompareTo(textSegment.End) < 0) || // 90(direction == LogicalDirection.Backward && textSegment.Start.CompareTo(textPosition) < 0 && textPosition.CompareTo(textSegment.End) <= 0)) 100internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 114if (direction == LogicalDirection.Forward)
System\Windows\Documents\TextServicesPropertyRanges.cs (2)
128start = _textstore.CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 129end = _textstore.CreatePointerAtCharOffset(startIndex + length, LogicalDirection.Forward);
System\Windows\Documents\TextStore.cs (73)
366this.TextSelection.SetCaretToPosition(start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 406navigator = CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 407limit = (endIndex >= 0) ? CreatePointerAtCharOffset(endIndex, LogicalDirection.Forward) : null; 414TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Forward); 428TextElement element = (TextElement)((TextPointer)navigator).GetAdjacentElement(LogicalDirection.Forward); 437navigator.MoveToNextContextPosition(LogicalDirection.Forward); 443navigator.MoveToNextContextPosition(LogicalDirection.Forward); 490start = start.GetNextInsertionPosition(LogicalDirection.Forward); 684startNavigator.SetLogicalDirection(LogicalDirection.Backward); 686endNavigator.SetLogicalDirection(LogicalDirection.Forward); 864position = CreatePointerAtCharOffset(index, LogicalDirection.Forward); 977ITextPointer positionCur = position.CreatePointer(LogicalDirection.Backward); 978ITextPointer positionPrev = position.CreatePointer(LogicalDirection.Forward); 979positionPrev.MoveToNextInsertionPosition(LogicalDirection.Backward); 1046startPointer = CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 1047startPointer.MoveToInsertionPosition(LogicalDirection.Forward); 1057Rect rectStart = startPointer.GetCharacterRect(LogicalDirection.Forward); 1065endPointer = CreatePointerAtCharOffset(endIndex, LogicalDirection.Backward); 1066endPointer.MoveToInsertionPosition(LogicalDirection.Backward); 1087lineRect = navigator.GetCharacterRect(LogicalDirection.Forward); 1088moved = navigator.MoveToNextInsertionPosition(LogicalDirection.Forward); 1482navigator.MoveToInsertionPosition(LogicalDirection.Forward); 1487if (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 1493navigator.GetTextInRun(LogicalDirection.Forward, nextChars, 0, nextChars.Length); 1499TextSelection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 1895internal ITextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 2004this.TextSelection.SetCaretToPosition(range.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 2378_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward); 2379_previousCompositionEnd = (_previousCompositionEndOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionEndOffset, LogicalDirection.Forward); 2397_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward); 2398_previousCompositionEnd = (_previousCompositionEndOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionEndOffset, LogicalDirection.Forward); 2445Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 2452runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2461runCount = navigator.GetTextRunLength(LogicalDirection.Forward); 2462navigator.MoveToNextContextPosition(LogicalDirection.Forward); 2504Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement); 2514navigator.MoveToNextContextPosition(LogicalDirection.Forward); 2546Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart || navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd); 2564char ch = (navigator.GetAdjacentElement(LogicalDirection.Forward) is TableCell) ? UnsafeNativeMethods.TS_CHAR_REGION : '\n'; 2897start = CreatePointerAtCharOffset(startIndex, LogicalDirection.Backward); 2898end = CreatePointerAtCharOffset(startIndex + length, LogicalDirection.Forward); 2900while (start.CompareTo(end) < 0 && start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 2902start.MoveToNextContextPosition(LogicalDirection.Forward); 3025positionNext.MoveToNextInsertionPosition(LogicalDirection.Forward); 3029positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward); 3168Rect lineBounds = start.GetCharacterRect(LogicalDirection.Forward); 3169lineBounds.Union(end.GetCharacterRect(LogicalDirection.Backward)); 3172ITextPointer navigator = start.CreatePointer(LogicalDirection.Forward); 3173while (navigator.MoveToNextContextPosition(LogicalDirection.Forward) && navigator.CompareTo(end) < 0) 3175TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Backward); 3179lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward)); 3184lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward)); 3399TextPointer previousPosition = start.GetNextInsertionPosition(LogicalDirection.Backward); 3412if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 3414start = start.GetNextInsertionPosition(LogicalDirection.Backward); 3418start = start.GetNextInsertionPosition(LogicalDirection.Forward); 3426start = start.GetNextInsertionPosition(LogicalDirection.Forward); 3446start = CreatePointerAtCharOffset(startCharOffset, LogicalDirection.Forward); 3447end = (startCharOffset == endCharOffset) ? start : CreatePointerAtCharOffset(endCharOffset, LogicalDirection.Backward); 3452TextPointerContext forwardContext = start.GetPointerContext(LogicalDirection.Forward); 3456TextElement element = start.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 3468start.MoveToNextContextPosition(LogicalDirection.Forward); 3479start = start.GetFormatNormalizedPosition(LogicalDirection.Backward); 3484start = start.GetFormatNormalizedPosition(LogicalDirection.Backward); 3485end = end.GetFormatNormalizedPosition(LogicalDirection.Backward); 3627ITextPointer start = this.TextContainer.CreatePointerAtOffset(record.StartOffsetBefore, LogicalDirection.Backward); 3628ITextPointer end = this.TextContainer.CreatePointerAtOffset(record.EndOffsetBefore, LogicalDirection.Forward); 3789start = end.GetFrozenPointer(LogicalDirection.Backward); 3946ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(appSelectionAnchorOffset, LogicalDirection.Forward); 3947ITextPointer moving = this.TextContainer.CreatePointerAtOffset(appSelectionMovingOffset, LogicalDirection.Forward); 3967ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(imeSelectionAnchorOffset, LogicalDirection.Backward); 3968ITextPointer moving = this.TextContainer.CreatePointerAtOffset(imeSelectionMovingOffset, LogicalDirection.Backward);
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (6)
39node = start.GetAdjacentNode(LogicalDirection.Forward); 40haltNode = end.GetAdjacentNode(LogicalDirection.Forward); 73navigator = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 425navigator.MoveToNextContextPosition(LogicalDirection.Backward); 441navigator.MoveToNextContextPosition(LogicalDirection.Forward); 473TextPointer textPointerTable = new TextPointer(navigator.TextContainer.Start, _cpTable, LogicalDirection.Forward);
System\Windows\Documents\TextTreeExtractElementUndoUnit.cs (3)
58start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 59end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount - 2, LogicalDirection.Forward); 69end.MoveToNextContextPosition(LogicalDirection.Backward);
System\Windows\Documents\TextTreeFixupNode.cs (1)
106internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreeInsertElementUndoUnit.cs (3)
53start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 55Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree."); 57element = start.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
System\Windows\Documents\TextTreeInsertUndoUnit.cs (2)
53start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 54end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount, LogicalDirection.Forward);
System\Windows\Documents\TextTreeNode.cs (4)
366internal abstract TextPointerContext GetPointerContext(LogicalDirection direction); 470return GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 473internal ElementEdge GetEdgeFromOffset(int nodeOffset, LogicalDirection bias) 482edge = (bias == LogicalDirection.Forward) ? ElementEdge.AfterEnd : ElementEdge.BeforeStart;
System\Windows\Documents\TextTreeObjectNode.cs (1)
71internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreePropertyUndoUnit.cs (2)
49position = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 51Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree.");
System\Windows\Documents\TextTreeRootNode.cs (1)
83internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreeTextElementNode.cs (2)
79internal override TextPointerContext GetPointerContext(LogicalDirection direction) 81return (direction == LogicalDirection.Forward) ? TextPointerContext.ElementStart : TextPointerContext.ElementEnd;
System\Windows\Documents\TextTreeTextNode.cs (1)
98internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\ValidationHelper.cs (4)
68internal static void VerifyDirection(LogicalDirection direction, string argumentName) 70if (direction != LogicalDirection.Forward && 71direction != LogicalDirection.Backward) 73throw new InvalidEnumArgumentException(argumentName, (int)direction, typeof(LogicalDirection));
System.Windows.Controls.Ribbon (7)
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
865strValue += textElement.ContentStart.GetTextInRun(LogicalDirection.Forward);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (6)
300string firstLineText = secondLinePointer.GetTextInRun(LogicalDirection.Backward); 301string secondLineText = secondLinePointer.GetTextInRun(LogicalDirection.Forward); 409lastCharacter = nextLinePointer.GetCharacterRect(LogicalDirection.Backward); 410firstCharacter = currentLinePointer.GetCharacterRect(LogicalDirection.Forward); 417lastCharacter = _textBlock1.ContentEnd.GetCharacterRect(LogicalDirection.Backward); 418firstCharacter = currentLinePointer.GetCharacterRect(LogicalDirection.Forward);