1898 references to LogicalDirection
PresentationFramework (1891)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (6)
107ITextPointer startPointer = segment.Start.CreatePointer(LogicalDirection.Forward); 114ITextPointer endPointer = segment.End.CreatePointer(LogicalDirection.Backward); 552if (!start.IsAtInsertionPosition && !start.MoveToNextInsertionPosition(LogicalDirection.Forward)) 576if (!end.IsAtInsertionPosition && !end.MoveToNextInsertionPosition(LogicalDirection.Backward)) 610start = textView.TextSegments[0].Start.CreatePointer(LogicalDirection.Forward); 611end = textView.TextSegments[textView.TextSegments.Count - 1].End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Anchoring\TextSelectionHelper.cs (5)
144current.MoveToNextContextPosition(LogicalDirection.Forward); 199IDocumentPaginatorSource content = GetPointerPage(pointer.CreatePointer(LogicalDirection.Forward), out pageNumber); 240return GetAnchorPointForPointer(anchor.Start.CreatePointer(LogicalDirection.Forward)); 432ITextPointer start = segment.Start.CreatePointer(LogicalDirection.Forward); 433ITextPointer end = segment.End.CreatePointer(LogicalDirection.Backward);
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (20)
244internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 253((highlightSegment.Segment.Start.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward))) 260((highlightSegment.Segment.End.CompareTo(textPosition) == 0) && (direction == LogicalDirection.Backward))) 271internal override bool IsContentHighlighted(StaticTextPointer staticTextPosition, LogicalDirection direction) 278internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 282if (direction == LogicalDirection.Forward) 767internal IList<HighlightSegment> Split(ITextPointer ps, LogicalDirection side) 772if (((ps.CompareTo(_segment.Start) == 0) && (side == LogicalDirection.Forward)) || 773((ps.CompareTo(_segment.End) == 0) && (side == LogicalDirection.Backward))) 830IList<HighlightSegment> r1 = Split(ps1, LogicalDirection.Forward); 835IList<HighlightSegment> r2 = r1[i].Split(ps2, LogicalDirection.Backward); 852res = Split(ps2, LogicalDirection.Backward); 998TextPointerContext nextContext = cursor.GetPointerContext(LogicalDirection.Forward); 1001Type elementType = cursor.GetElementType(LogicalDirection.Forward); 1015cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1035cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1043cursor.MoveToNextContextPosition(LogicalDirection.Forward); 1063segmentStart = cursor.GetInsertionPosition(LogicalDirection.Forward); 1080ITextPointer segmentEnd = cursor.GetInsertionPosition(LogicalDirection.Backward); 1110ITextView parentView = TextSelectionHelper.GetDocumentPageTextView(TopOwner.Range.Start.CreatePointer(LogicalDirection.Forward));
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (8)
661ITextPointer start = anchor.Start.CreatePointer(LogicalDirection.Forward); 662ITextPointer end = anchor.End.CreatePointer(LogicalDirection.Backward); 799LogicalDirection direction = pointer.LogicalDirection; 827nextPointer = nextPointer.CreatePointer(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 833if (direction == LogicalDirection.Forward) 858if (direction == LogicalDirection.Backward)
MS\Internal\Annotations\TextAnchor.cs (8)
117textPointer = textPointer.GetInsertionPosition(LogicalDirection.Forward); 121textPointer = textPointer.GetInsertionPosition(LogicalDirection.Backward); 219(theirSegment.Start.LogicalDirection == LogicalDirection.Forward)) 225(theirSegment.End.LogicalDirection == LogicalDirection.Backward)) 670start = start.GetInsertionPosition(LogicalDirection.Forward); 674end = end.GetInsertionPosition(LogicalDirection.Backward); 681if (start.LogicalDirection == LogicalDirection.Backward) 684start = end.GetFrozenPointer(LogicalDirection.Backward);
MS\Internal\Documents\DocumentGrid.cs (1)
306tp = tp.CreatePointer(LogicalDirection.Forward);
MS\Internal\Documents\DocumentPageTextView.cs (1)
258internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\DocumentViewerHelper.cs (1)
404contextMenuPosition = textContainer.TextSelection.Start.CreatePointer(LogicalDirection.Forward);
MS\Internal\Documents\HostedElements.cs (9)
102_currentPosition.MoveToNextContextPosition(LogicalDirection.Forward); 111if (_currentPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart || 112_currentPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement) 118_currentPosition.MoveToNextContextPosition(LogicalDirection.Forward); 184switch (_currentPosition.GetPointerContext(LogicalDirection.Forward)) 187Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 188currentElement = _currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 191Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement); 192currentElement = (IInputElement)_currentPosition.GetAdjacentElement(LogicalDirection.Forward);
MS\Internal\Documents\LineResult.cs (1)
44internal abstract ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction);
MS\Internal\Documents\MultiPageTextView.cs (1)
238internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\ParagraphResult.cs (1)
385internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\Documents\TableTextElementCollectionInternal.cs (2)
157TextPointer startPosition = new TextPointer(item.TextContainer, item.TextElementNode, ElementEdge.BeforeStart, LogicalDirection.Backward); 158TextPointer endPosition = new TextPointer(item.TextContainer, item.TextElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
MS\Internal\Documents\TextBoxLine.cs (8)
81switch (position.GetPointerContext(LogicalDirection.Forward)) 119ITextPointer position = _owner.Host.TextContainer.CreatePointerAtOffset(dcp, LogicalDirection.Backward); 124int runLength = Math.Min(128, position.GetTextRunLength(LogicalDirection.Backward)); 126position.GetTextInRun(LogicalDirection.Backward, text, 0, runLength); 431StaticTextPointer endOfRunPosition = _owner.Host.TextContainer.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 443TextDecorationCollection highlightDecorations = highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection; 461&& highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(TextSelection)) != DependencyProperty.UnsetValue) 490int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length);
MS\Internal\Documents\TextBoxView.cs (53)
633if (offset > 0 && position.LogicalDirection == LogicalDirection.Backward) 657if (position.LogicalDirection == LogicalDirection.Forward || position.Offset == 0) 664if (position.LogicalDirection == LogicalDirection.Backward && position.Offset > 0) 705firstLineIndex = Math.Max(firstLineIndex, GetLineIndexFromOffset(startOffset, LogicalDirection.Forward)); 706lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward)); 745ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].EndOffset, LogicalDirection.Backward); 746if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 785nextLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex + linesMoved].Offset, LogicalDirection.Forward); 824if (position.LogicalDirection == LogicalDirection.Forward) 829else if (position.LogicalDirection == LogicalDirection.Backward) 854ITextPointer ITextView.GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 860if (position.Offset == 0 && direction == LogicalDirection.Backward) 862return position.GetFrozenPointer(LogicalDirection.Forward); 864else if (position.Offset == _host.TextContainer.SymbolCount && direction == LogicalDirection.Forward) 866return position.GetFrozenPointer(LogicalDirection.Backward); 876if (direction == LogicalDirection.Forward) 889LogicalDirection logicalDirection; 891direction == LogicalDirection.Forward) 897logicalDirection = LogicalDirection.Backward; 901logicalDirection = LogicalDirection.Forward; 905direction == LogicalDirection.Backward) 911logicalDirection = LogicalDirection.Forward; 915logicalDirection = LogicalDirection.Backward; 920logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 939return position.GetFrozenPointer(LogicalDirection.Forward); 942int lineIndex = GetLineIndexFromPosition(position, LogicalDirection.Backward); 952LogicalDirection logicalDirection; 959logicalDirection = LogicalDirection.Forward; 963logicalDirection = LogicalDirection.Backward; 968logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 986ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].Offset, LogicalDirection.Forward); 987ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].Offset + _lineMetrics[lineIndex].ContentLength, LogicalDirection.Forward); 1307ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[0].Offset, LogicalDirection.Backward); 1308ITextPointer end = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[_lineMetrics.Count - 1].EndOffset, LogicalDirection.Forward); 1702private int GetLineIndexFromPosition(ITextPointer position, LogicalDirection direction) 1708private int GetLineIndexFromOffset(int offset, LogicalDirection direction) 1710if (offset > 0 && direction == LogicalDirection.Backward) 1756LogicalDirection logicalDirection; 1762logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 1937int firstLineIndex = GetLineIndexFromOffset(range.StartIndex, LogicalDirection.Forward); 1939int lastLineIndex = GetLineIndexFromOffset(endOffset, LogicalDirection.Backward); 2059ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward); 2060if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward)) 2104ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward); 2106if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 2155ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward); 2156if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward)) 2183ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward); 2185if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward)) 2386int lineIndex = GetLineIndexFromOffset(range.StartIndex, LogicalDirection.Forward);
MS\Internal\Documents\TextContainerHelper.cs (23)
95_textContainer.CreatePointerAtOffset(_cpFirst, LogicalDirection.Forward), 96_textContainer.CreatePointerAtOffset(_cpLast, LogicalDirection.Backward), 105_textContainer.CreatePointerAtOffset(_ranges[i * 2], LogicalDirection.Forward), 106_textContainer.CreatePointerAtOffset(_ranges[i * 2 + 1], LogicalDirection.Backward), 124if (cpPos == _cpFirst && position.LogicalDirection == LogicalDirection.Backward || 125cpPos == _cpLast && position.LogicalDirection == LogicalDirection.Forward) 141if (cpPos == _ranges[i * 2] && position.LogicalDirection == LogicalDirection.Backward || 142cpPos == _ranges[i * 2 + 1] && position.LogicalDirection == LogicalDirection.Forward) 160startPosition = _textContainer.CreatePointerAtOffset(IsSimple ? _cpFirst : _ranges[0], LogicalDirection.Forward); 172endPosition = _textContainer.CreatePointerAtOffset(IsSimple ? _cpLast : _ranges[(_size - 1) * 2 + 1], LogicalDirection.Backward); 324if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 327element = start.GetAdjacentElement(LogicalDirection.Forward); 339start.MoveToNextContextPosition(LogicalDirection.Forward); 345else if (start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement) 348element = start.GetAdjacentElement(LogicalDirection.Forward); 381if (!start.MoveToNextContextPosition(LogicalDirection.Forward)) 409object element = position.GetAdjacentElement(LogicalDirection.Forward); 447element = position.GetAdjacentElement(LogicalDirection.Forward); 451positionsStart.Insert(0, position.CreatePointer(LogicalDirection.Forward)); 463element = position.GetAdjacentElement(LogicalDirection.Backward); 467positionsEnd.Insert(0, position.CreatePointer(LogicalDirection.Backward)); 552textPointer = textContainer.CreatePointerAtOffset(0, LogicalDirection.Forward); // Start 587internal static ITextPointer GetTextPointerFromCP(ITextContainer textContainer, int cp, LogicalDirection direction)
MS\Internal\Documents\TextDocumentView.cs (29)
299internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 482if (position.LogicalDirection == LogicalDirection.Forward) 492if (segment.Start.LogicalDirection == LogicalDirection.Backward) 501if (position.LogicalDirection == LogicalDirection.Backward) 511if (segment.End.LogicalDirection == LogicalDirection.Forward) 524if (position.TextContainer.Start.CompareTo(position) == 0 && position.LogicalDirection == LogicalDirection.Backward) 528else if (position.TextContainer.End.CompareTo(position) == 0 && position.LogicalDirection == LogicalDirection.Forward) 767position = paragraph.StartPosition.CreatePointer(LogicalDirection.Forward); 771position = paragraph.EndPosition.CreatePointer(LogicalDirection.Backward); 873position = blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward); 877position = blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward); 887position = paragraph.StartPosition.CreatePointer(LogicalDirection.Forward); 891position = paragraph.EndPosition.CreatePointer(LogicalDirection.Backward); 1576private ITextPointer GetNextCaretUnitPosition(ReadOnlyCollection<ParagraphResult> paragraphs, ReadOnlyCollection<ParagraphResult> floatingElements, ITextPointer position, LogicalDirection direction) 1613private ITextPointer GetNextCaretUnitPosition(ParagraphResult paragraph, ITextPointer position, LogicalDirection direction) 1685private ITextPointer GetNextCaretUnitPosition(ReadOnlyCollection<ColumnResult> columns, ReadOnlyCollection<ParagraphResult> floatingElements, ITextPointer position, LogicalDirection direction) 2402lineRange = new TextSegment(blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward), blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward)); 2530positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 2550positionOut = lines[0].StartPosition.CreatePointer(LogicalDirection.Forward); 2562positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 2905positionOut = blockUIContainer.ContentStart.CreatePointer(LogicalDirection.Forward); 2909positionOut = blockUIContainer.ContentEnd.CreatePointer(LogicalDirection.Backward); 3012positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 3027positionOut = lines[0].StartPosition.CreatePointer(LogicalDirection.Forward); 3039positionOut = lines[lines.Count - 1].StartPosition.CreatePointer(LogicalDirection.Forward); 3290segmentEnd = _textContainer.Start.CreatePointer(backgroundFormatInfo.CPInterrupted, LogicalDirection.Backward); 3483if (textPointer.LogicalDirection == LogicalDirection.Forward && textPointer.CompareTo(textElement.ElementStart) == 0) 3488if (textPointer.LogicalDirection == LogicalDirection.Backward && textPointer.CompareTo(textElement.ElementEnd) == 0)
MS\Internal\Documents\TextParagraphView.cs (6)
184positionOut = lines[lineIndex].StartPosition.CreatePointer(LogicalDirection.Forward); 213internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 403if (position.LogicalDirection == LogicalDirection.Forward && (lineIndex != lines.Count - 1)) 410if (position.LogicalDirection == LogicalDirection.Backward && lineIndex != 0) 422( position.LogicalDirection == LogicalDirection.Backward || 423(position.LogicalDirection == LogicalDirection.Forward && (lineIndex == lines.Count - 1)))));
MS\Internal\Documents\TextViewBase.cs (2)
92internal abstract ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction); 523ITextPointer ITextView.GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
MS\Internal\PtsHost\ContainerParagraph.cs (3)
249ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, prevParagraph.ParagraphEndCharacterPosition, LogicalDirection.Forward); 1032switch (textPointer.GetPointerContext(LogicalDirection.Forward)) 1065TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\FlowDocumentPage.cs (3)
963switch (searchPosition.GetPointerContext(LogicalDirection.Forward)) 966DependencyObject embeddedObject = searchPosition.GetAdjacentElement(LogicalDirection.Forward); 980searchPosition.MoveToNextContextPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\Line.cs (9)
158switch (position.GetPointerContext(LogicalDirection.Forward)) 204ITextPointer startPosition = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara, LogicalDirection.Forward); 205ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward); 208while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 217string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 608position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, cp, LogicalDirection.Forward) as TextPointer; 613type = position.GetPointerContext((charIndex.TrailingLength == 0) ? LogicalDirection.Forward : LogicalDirection.Backward); 623element = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\LineBase.cs (9)
92Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 112endOfRunPosition = position.TextContainer.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 127int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 141Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 145TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 256Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 267TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 310Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object."); 313DependencyObject embeddedObject = position.GetAdjacentElement(LogicalDirection.Forward) as DependencyObject;
MS\Internal\PtsHost\ListParagraph.cs (4)
80TextPointerContext runType = textPointer.GetPointerContext(LogicalDirection.Forward); 83TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 129textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 139textPointer.MoveToNextContextPosition(LogicalDirection.Forward);
MS\Internal\PtsHost\OptimalTextSource.cs (6)
106switch (position.GetPointerContext(LogicalDirection.Forward)) 153ITextPointer startPosition = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara, LogicalDirection.Forward); 154ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward); 157while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 166string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 192ITextPointer position = TextContainerHelper.GetTextPointerFromCP(_paraClient.Paragraph.StructuralCache.TextContainer, _cpPara + dcp, LogicalDirection.Forward);
MS\Internal\PtsHost\TextParaClient.cs (56)
649RectFromDcpSimpleLines(0, 0, LogicalDirection.Forward, TextPointerContext.Text, ref textDetails.u.full, ref rect, ref vrBaseline); 654RectFromDcpCompositeLines(0, 0, LogicalDirection.Forward, TextPointerContext.Text, ref textDetails.u.full, ref rect, ref vrBaseline); 666internal ITextPointer GetTextPosition(int dcp, LogicalDirection direction) 685if (position.LogicalDirection == LogicalDirection.Backward && dcp > 0) 877internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 1097LogicalDirection logicalDirection = (charHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 1638LogicalDirection orientation, 1690if (orientation == LogicalDirection.Forward) 1703if (orientation == LogicalDirection.Backward && originalDcp > 0 && (context == TextPointerContext.Text || context == TextPointerContext.EmbeddedElement)) 1726LogicalDirection orientation, 1787if (orientation == LogicalDirection.Forward) 1797if (orientation == LogicalDirection.Backward && originalDcp > 0 && (context == TextPointerContext.Text || context == TextPointerContext.EmbeddedElement)) 2040ITextPointer position = Paragraph.StructuralCache.TextContainer.CreatePointerAtOffset(Paragraph.ParagraphStartCharacterPosition + dcp, LogicalDirection.Forward); 2042return (TextPointerBase.IsNextToAnyBreak(position, LogicalDirection.Backward)); 2404if (position.LogicalDirection == LogicalDirection.Backward) 2429else if (position.LogicalDirection == LogicalDirection.Forward) 2507if (position.LogicalDirection == LogicalDirection.Backward) 2553else if (position.LogicalDirection == LogicalDirection.Forward) 2589LogicalDirection direction, 2614if (dcp == lineDesc.dcpFirst && direction == LogicalDirection.Backward) 2629else if (dcp >= lineDesc.dcpLim - 1 && direction == LogicalDirection.Forward) 2658if (direction == LogicalDirection.Forward) 2667LogicalDirection logicalDirection; 2668if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == lineDesc.dcpLim) && direction == LogicalDirection.Forward) 2674logicalDirection = LogicalDirection.Backward; 2678logicalDirection = LogicalDirection.Forward; 2681else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == lineDesc.dcpFirst) && direction == LogicalDirection.Backward) 2687logicalDirection = LogicalDirection.Forward; 2691logicalDirection = LogicalDirection.Backward; 2696logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2714LogicalDirection direction, 2748if (dcp == element.dcpFirst && direction == LogicalDirection.Backward) 2788else if (dcp >= element.dcpLim - 1 && direction == LogicalDirection.Forward) 2821if (direction == LogicalDirection.Forward) 2830LogicalDirection logicalDirection; 2831if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == element.dcpLim) && direction == LogicalDirection.Forward) 2837logicalDirection = LogicalDirection.Backward; 2842logicalDirection = LogicalDirection.Forward; 2845else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == element.dcpFirst) && direction == LogicalDirection.Backward) 2851logicalDirection = LogicalDirection.Forward; 2856logicalDirection = LogicalDirection.Backward; 2861logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2937LogicalDirection logicalDirection; 2944logicalDirection = LogicalDirection.Forward; 2948logicalDirection = LogicalDirection.Backward; 2953logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 3063LogicalDirection logicalDirection; 3070logicalDirection = LogicalDirection.Forward; 3074logicalDirection = LogicalDirection.Backward; 3079logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
MS\Internal\PtsHost\TextParagraph.cs (12)
590StructuralCache.CurrentFormatContext.DependentMax = StructuralCache.TextContainer.CreatePointerAtOffset(dcpDependAbsolute, LogicalDirection.Backward); 774StructuralCache.CurrentFormatContext.DependentMax = StructuralCache.TextContainer.CreatePointerAtOffset(dcpDependAbsolute, LogicalDirection.Backward); 885ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, ParagraphStartCharacterPosition + dcpFirst, LogicalDirection.Forward); 888while(textPointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 890TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 909ITextPointer textPointer = TextContainerHelper.GetTextPointerFromCP(StructuralCache.TextContainer, ParagraphStartCharacterPosition + dcpFirst, LogicalDirection.Forward); 918if(textPointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 920TextElement element = ((TextPointer)textPointer).GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 929textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 934textPointer.MoveToNextContextPosition(LogicalDirection.Forward); 1220if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1222invalid = (objectElement != position.GetAdjacentElement(LogicalDirection.Forward));
MS\Internal\PtsHost\TextParaLineResult.cs (5)
70internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 112return _owner.GetTextPosition(_dcp + _cchContent, LogicalDirection.Backward); 124return _owner.GetTextPosition(_dcp + _cch - _cchEllipses, LogicalDirection.Forward); 176_startPosition = _owner.GetTextPosition(_dcp, LogicalDirection.Forward); 191_endPosition = _owner.GetTextPosition(_dcp + _cch, LogicalDirection.Backward);
MS\Internal\Text\ComplexLine.cs (17)
47switch (position.GetPointerContext(LogicalDirection.Forward)) 94ITextPointer position = _owner.TextContainer.CreatePointerAtOffset(dcp, LogicalDirection.Backward); 97while (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 105string precedingTextString = position.GetTextInRun(LogicalDirection.Backward); 288position = new TextPointer(_owner.ContentStart, CalcPositionOffset(charHit), LogicalDirection.Forward); 295type = position.GetPointerContext(LogicalDirection.Forward); 300type = position.GetPointerContext(LogicalDirection.Backward); 311element = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 339Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 358endOfRunPosition = _owner.Highlights.GetNextPropertyChangePosition(position, LogicalDirection.Forward); 373int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 386Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 390TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 477Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 481TextElement element = (TextElement)position.GetAdjacentElement(LogicalDirection.Forward); 527Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object."); 530DependencyObject element = position.GetAdjacentElement(LogicalDirection.Forward) as DependencyObject;
MS\Internal\Text\DynamicPropertyReader.cs (1)
260selected = position.TextContainer.Highlights.GetHighlightValue(position, LogicalDirection.Forward, typeof(TextSelection));
MS\Internal\Text\TextLineResult.cs (5)
66internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 106return _owner.TextContainer.CreatePointerAtOffset(_dcp + _cchContent, LogicalDirection.Backward); 122return _owner.TextContainer.CreatePointerAtOffset(_dcp + _cch - _cchEllipses, LogicalDirection.Forward); 174_startPosition = _owner.TextContainer.CreatePointerAtOffset(_dcp, LogicalDirection.Forward); 189_endPosition = _owner.TextContainer.CreatePointerAtOffset(_dcp + _cch, LogicalDirection.Backward);
MS\Internal\Text\TextProperties.cs (1)
236textDecorations = highlights.GetHighlightValue(highlightPosition, LogicalDirection.Forward, typeof(SpellerHighlightLayer)) as TextDecorationCollection;
System\Windows\Annotations\AnnotationHelper.cs (4)
687start.MoveToNextInsertionPosition(LogicalDirection.Backward); 688end.MoveToNextInsertionPosition(LogicalDirection.Forward); 870(selection.Start.LogicalDirection == LogicalDirection.Forward)) || 872(selection.End.LogicalDirection == LogicalDirection.Backward)))
System\Windows\Automation\Peers\TextElementAutomationPeer.cs (1)
121TextPointer endPosition = textElement.ContentStart.GetNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Controls\AccessText.cs (6)
579TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 583string text = navigator.GetTextInRun(LogicalDirection.Forward); 616navigator.MoveToNextContextPosition(LogicalDirection.Forward); 625TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 629string text = navigator.GetTextInRun(LogicalDirection.Forward); 652navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Controls\FlowDocumentReader.cs (4)
1990public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom, FlowDocumentReaderViewingMode viewingMode) 1998public LogicalDirection ContentPositionDirection; 2009LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\FlowDocumentScrollViewer.cs (4)
1923public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom) 1930public LogicalDirection ContentPositionDirection; 1940LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\PasswordBox.cs (2)
1085while (start-- > 0 && selectionStart.MoveToNextInsertionPosition(LogicalDirection.Forward)) 1091while (length-- > 0 && selectionEnd.MoveToNextInsertionPosition(LogicalDirection.Forward))
System\Windows\Controls\PasswordTextContainer.cs (20)
215ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 221ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 226ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 233return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 236TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 246int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 251object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 266StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 517return new PasswordTextPointer(this, LogicalDirection.Backward, 0); 531return new PasswordTextPointer(this, LogicalDirection.Forward, this.SymbolCount); 673textPosition = new PasswordTextPointer(this, LogicalDirection.Forward, offset); 710index = FindIndex(offset, LogicalDirection.Forward); 743if (position.LogicalDirection == LogicalDirection.Backward) 807private int FindIndex(int offset, LogicalDirection gravity) 821(position.LogicalDirection == gravity || gravity == LogicalDirection.Backward)) 842LogicalDirection lastLogicalDirection; 845lastLogicalDirection = LogicalDirection.Backward; 857position.LogicalDirection == LogicalDirection.Backward && 862Invariant.Assert(lastLogicalDirection != LogicalDirection.Forward); 913Debug.Write($"({position.DebugId}) {position.Offset}/{((position.LogicalDirection == LogicalDirection.Forward) ? "f " : "b ")}");
System\Windows\Controls\PasswordTextNavigator.cs (27)
30internal PasswordTextPointer(PasswordTextContainer container, LogicalDirection gravity, int offset) 54void ITextPointer.SetLogicalDirection(LogicalDirection direction) 138TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 142if ((direction == LogicalDirection.Backward && _offset == 0) || 143(direction == LogicalDirection.Forward && _offset == _container.SymbolCount)) 170int ITextPointer.GetTextRunLength(LogicalDirection direction) 174if (direction == LogicalDirection.Forward) 187string ITextPointer.GetTextInRun(LogicalDirection direction) 192int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 198if (direction == LogicalDirection.Forward) 227object ITextPointer.GetAdjacentElement(LogicalDirection direction) 247Type ITextPointer.GetElementType(LogicalDirection direction) 332ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 354ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 368ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 423bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 429if (direction == LogicalDirection.Backward) 523Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 528bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 533bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 540ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 555ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 564ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 581ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 653LogicalDirection ITextPointer.LogicalDirection 704internal LogicalDirection LogicalDirection 756private LogicalDirection _gravity;
System\Windows\Controls\RichTextBox.cs (1)
271public TextPointer GetNextSpellingErrorPosition(TextPointer position, LogicalDirection direction)
System\Windows\Controls\SinglePageViewer.cs (4)
1522public JournalState(int contentPosition, LogicalDirection contentPositionDirection, double zoom) 1529public LogicalDirection ContentPositionDirection; 1539LogicalDirection cpDirection = LogicalDirection.Forward;
System\Windows\Controls\TextAdaptor.cs (12)
118TextRangeAdaptor.MoveToInsertionPosition(start, LogicalDirection.Forward); 119TextRangeAdaptor.MoveToInsertionPosition(end, LogicalDirection.Backward); 279FrameworkContentElement element = pointer.GetAdjacentElement(LogicalDirection.Backward) as FrameworkContentElement; 618TextPointerContext context = position.GetPointerContext(LogicalDirection.Forward); 621if (childElement == position.GetAdjacentElement(LogicalDirection.Forward)) 623rangeStart = position.CreatePointer(LogicalDirection.Forward); 625rangeEnd = position.CreatePointer(LogicalDirection.Backward); 631if (childElement == position.GetAdjacentElement(LogicalDirection.Forward)) 633rangeStart = position.CreatePointer(LogicalDirection.Forward); 634position.MoveToNextContextPosition(LogicalDirection.Forward); 635rangeEnd = position.CreatePointer(LogicalDirection.Backward); 639position.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Controls\TextBlock.cs (29)
2154LogicalDirection logicalDirection; 2156logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2188if (orientedPosition.LogicalDirection == LogicalDirection.Backward && characterIndex > 0) 2246if (orientedPosition.LogicalDirection == LogicalDirection.Forward || originalCharacterIndex == 0) 2256if (orientedPosition.LogicalDirection == LogicalDirection.Backward && originalCharacterIndex > 0) 2349&& TextPointerBase.IsNextToAnyBreak(endOfLineTextPointer, LogicalDirection.Backward)) 2400if (position.LogicalDirection == LogicalDirection.Backward) 2414else if (position.LogicalDirection == LogicalDirection.Forward) 2456internal ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction, int dcp, int lineIndex) 2467if (characterIndex == dcp && direction == LogicalDirection.Backward) 2484else if (characterIndex == (dcp + GetLine(lineIndex).Length) && direction == LogicalDirection.Forward) 2520if (direction == LogicalDirection.Forward) 2533LogicalDirection logicalDirection; 2534if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == (dcp + GetLine(lineIndex).Length)) && direction == LogicalDirection.Forward) 2540logicalDirection = LogicalDirection.Backward; 2544logicalDirection = LogicalDirection.Forward; 2547else if ((nextCharacterHit.FirstCharacterIndex + nextCharacterHit.TrailingLength == dcp) && direction == LogicalDirection.Backward) 2553logicalDirection = LogicalDirection.Forward; 2557logicalDirection = LogicalDirection.Backward; 2562logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 2634LogicalDirection logicalDirection; 2641logicalDirection = LogicalDirection.Forward; 2645logicalDirection = LogicalDirection.Backward; 2650logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 3669switch (position.GetPointerContext(LogicalDirection.Forward)) 3672DependencyObject embeddedObject = position.GetAdjacentElement(LogicalDirection.Forward);
System\Windows\Controls\TextBox.cs (24)
166TextPointer newStart = this.TextContainer.CreatePointerAtOffset(start, LogicalDirection.Forward); 170newStart = newStart.GetInsertionPosition(LogicalDirection.Forward); 178TextPointer newEnd = new TextPointer(newStart, length, LogicalDirection.Forward); 181newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 221return (textPointer.LogicalDirection == LogicalDirection.Backward) ? offset - 1 : offset; 269TextPointer position = this.TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Forward); 444TextPointer textPointer = TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Backward); 445textPointer = textPointer.GetInsertionPosition(LogicalDirection.Backward); 450textPointer = textPointer.GetNextInsertionPosition(LogicalDirection.Forward); 454textPointer = textPointer.GetPositionAtOffset(0, LogicalDirection.Backward); 459textPointer = textPointer.GetPositionAtOffset(0, LogicalDirection.Forward); 484TextPointer position = this.TextContainer.CreatePointerAtOffset(charIndex, LogicalDirection.Forward); 485SpellingError spellingError = this.TextEditor.GetSpellingErrorAtPosition(position, LogicalDirection.Forward); 489position = this.TextContainer.CreatePointerAtOffset(charIndex + 1, LogicalDirection.Forward); 490spellingError = this.TextEditor.GetSpellingErrorAtPosition(position, LogicalDirection.Backward); 550public int GetNextSpellingErrorCharacterIndex(int charIndex, LogicalDirection direction) 816TextPointer newEnd = new TextPointer(TextSelectionInternal.Start, value, LogicalDirection.Forward); 819newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 860TextPointer newStart = TextContainer.CreatePointerAtOffset(value, LogicalDirection.Forward); 864newStart = newStart.GetInsertionPosition(LogicalDirection.Forward); 872TextPointer newEnd = new TextPointer(newStart, selectionLength, LogicalDirection.Forward); 875newEnd = newEnd.GetInsertionPosition(LogicalDirection.Forward); 1482if (TextPointerBase.IsNextToPlainLineBreak(textPointer, LogicalDirection.Forward)) 1484textPointer.MoveToNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Controls\TextRangeAdaptor.cs (77)
482internal static bool MoveToInsertionPosition(ITextPointer position, LogicalDirection direction) 530TextPointerBase.MoveToNextInsertionPosition(_start, LogicalDirection.Backward); 534TextPointerBase.MoveToNextInsertionPosition(_end, LogicalDirection.Forward); 541MoveToNextWordBoundary(_start, LogicalDirection.Backward); 545MoveToNextWordBoundary(_end, LogicalDirection.Forward); 555TextPointerContext forwardContext = _start.GetPointerContext(LogicalDirection.Forward); 558TextPointerContext backwardContext = _start.GetPointerContext(LogicalDirection.Backward); 566_start.MoveToNextContextPosition(LogicalDirection.Backward); 572TextPointerContext backwardContext = _end.GetPointerContext(LogicalDirection.Backward); 575TextPointerContext forwardContext = _end.GetPointerContext(LogicalDirection.Forward); 583_end.MoveToNextContextPosition(LogicalDirection.Forward); 589_start.SetLogicalDirection(LogicalDirection.Forward); 590_end.SetLogicalDirection(LogicalDirection.Forward); 727private bool MoveToUnitBoundary(ITextPointer position, bool isStart, LogicalDirection direction, TextUnit unit) 765if (moved && direction == LogicalDirection.Forward) 769TextPointerContext context = position.GetPointerContext(LogicalDirection.Forward); 774position.MoveToNextContextPosition(LogicalDirection.Forward); 793if (direction == LogicalDirection.Forward) 811nextLineStart = GetInsertionPosition(nextLineStart, LogicalDirection.Forward); 816position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 838previousLineEnd = GetInsertionPosition(previousLineEnd, LogicalDirection.Backward); 843position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 856if (direction == LogicalDirection.Forward) 863if (nextParagraphStart.MoveToNextInsertionPosition(LogicalDirection.Forward)) 873position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 884if (previousParagraphEnd.MoveToNextInsertionPosition(LogicalDirection.Backward)) 894position.SetLogicalDirection(isStart ? LogicalDirection.Forward : LogicalDirection.Backward); 923if (direction == LogicalDirection.Forward) 927if (position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementEnd) 933Invariant.Assert(position.MoveToNextContextPosition(LogicalDirection.Forward)); 935MoveToInsertionPosition(position, LogicalDirection.Forward); 941if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart) 947Invariant.Assert(position.MoveToNextContextPosition(LogicalDirection.Backward)); 949MoveToInsertionPosition(position, LogicalDirection.Backward); 956if (direction == LogicalDirection.Forward) 958if (position.CompareTo(GetInsertionPosition(position.TextContainer.End, LogicalDirection.Backward)) != 0) 966if (position.CompareTo(GetInsertionPosition(position.TextContainer.Start, LogicalDirection.Forward)) != 0) 996LogicalDirection direction = (count > 0) ? LogicalDirection.Forward : LogicalDirection.Backward; 1053if (direction == LogicalDirection.Backward) 1055while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) 1057if (!position.MoveToNextContextPosition(LogicalDirection.Backward)) 1077position.SetLogicalDirection(LogicalDirection.Forward); 1094position.MoveToNextInsertionPosition(LogicalDirection.Backward); 1099MoveToInsertionPosition(position, LogicalDirection.Forward); 1114position.MoveToPosition(direction == LogicalDirection.Forward ? paragraphRange.End : paragraphRange.Start); 1145if (direction == LogicalDirection.Backward) 1148MoveToInsertionPosition(position, LogicalDirection.Backward); 1153MoveToInsertionPosition(position, LogicalDirection.Forward); 1165if (direction == LogicalDirection.Forward) 1198return (direction == LogicalDirection.Forward) ? moved : -moved; 1213while (IsElementBoundary(start.GetPointerContext(LogicalDirection.Forward))) 1215if (!start.MoveToNextContextPosition(LogicalDirection.Forward) || start.CompareTo(end) >= 0) 1220while (IsElementBoundary(end.GetPointerContext(LogicalDirection.Backward))) 1222if (!end.MoveToNextContextPosition(LogicalDirection.Backward) || start.CompareTo(end) >= 0) 1237if (!start.MoveToNextContextPosition(LogicalDirection.Forward) || start.CompareTo(end) > 0) 1448return TextPointerBase.IsAtWordBoundary(position, LogicalDirection.Forward); 1456private static bool MoveToNextWordBoundary(ITextPointer position, LogicalDirection direction) 1482position.SetLogicalDirection(LogicalDirection.Forward); 1507private ITextPointer GetInsertionPosition(ITextPointer position, LogicalDirection direction) 1640_end.MoveToNextInsertionPosition(LogicalDirection.Forward); 1675ITextPointer position = _end.CreatePointer(LogicalDirection.Backward); 1686attrEnd = position.CreatePointer(LogicalDirection.Backward); 1693attrStart = position.CreatePointer(LogicalDirection.Forward); 1697if (!position.MoveToNextContextPosition(LogicalDirection.Backward)) 1706ITextPointer position = _start.CreatePointer(LogicalDirection.Forward); 1717attrStart = position.CreatePointer(LogicalDirection.Forward); 1724attrEnd = position.CreatePointer(LogicalDirection.Backward); 1728if (!position.MoveToNextContextPosition(LogicalDirection.Forward)) 1911_end.MoveToNextInsertionPosition(LogicalDirection.Forward); 1949if (MoveToUnitBoundary(position, start, count < 0 ? LogicalDirection.Backward : LogicalDirection.Forward, unit))
System\Windows\Documents\BlockUIContainer.cs (1)
73return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement;
System\Windows\Documents\ColumnResizeUndoUnit.cs (1)
46textPointerTable = new TextPointer(_textContainer.Start, _cpTable, LogicalDirection.Forward);
System\Windows\Documents\CompositionAdorner.cs (12)
328ITextPointer rangeStart = start.CreatePointer(LogicalDirection.Forward); 329ITextPointer rangeEnd = end.CreatePointer(LogicalDirection.Backward); 485ITextPointer start = _textView.TextContainer.Start.CreatePointer(_startOffset, LogicalDirection.Forward); 486ITextPointer end = _textView.TextContainer.Start.CreatePointer(_endOffset, LogicalDirection.Backward); 488while (start.CompareTo(end) < 0 && start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 490start.MoveToNextContextPosition(LogicalDirection.Forward); 493Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 607endLinePointer = textSegment.End.CreatePointer(LogicalDirection.Backward); 622startLinePointer = textSegment.End.CreatePointer(LogicalDirection.Forward); 627while ((startLinePointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) && 628(startLinePointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text)) 630startLinePointer.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (3)
53internal override object GetHighlightValue(StaticTextPointer staticTextPointer, LogicalDirection direction) 61internal override bool IsContentHighlighted(StaticTextPointer staticTextPointer, LogicalDirection direction) 68internal override StaticTextPointer GetNextChangePosition(StaticTextPointer staticTextPointer, LogicalDirection direction)
System\Windows\Documents\DocumentSequenceTextContainer.cs (25)
111ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 117ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 122ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 129return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 132TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 142int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 147object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 162StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 677if (!highlights.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 679highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 687selected = highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)); 691highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 698if (highlightRangeStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 705TextPointerBase.GetTextWithLimit(highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), LogicalDirection.Forward, sb, 0, 256, highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward)); 880internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 901internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 923internal override StaticTextPointer GetNextHighlightChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 966internal override StaticTextPointer GetNextPropertyChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 991private bool EnsureParentPosition(StaticTextPointer textPosition, LogicalDirection direction, out StaticTextPointer parentPosition) 1005ITextPointer dynamicTextPointer = textPosition.CreateDynamicTextPointer(LogicalDirection.Forward); 1023private StaticTextPointer GetStaticPositionInChildContainer(StaticTextPointer textPosition, LogicalDirection direction, StaticTextPointer originalPosition) 1029DocumentSequenceTextPointer parentChangePosition = textPosition.CreateDynamicTextPointer(LogicalDirection.Forward) as DocumentSequenceTextPointer; 1042childTp = direction == LogicalDirection.Forward ?
System\Windows\Documents\DocumentSequenceTextPointer.cs (52)
55void ITextPointer.SetLogicalDirection(LogicalDirection direction) 88TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 97int ITextPointer.GetTextRunLength(LogicalDirection direction) 103string ITextPointer.GetTextInRun(LogicalDirection direction) 109/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 112int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 121object ITextPointer.GetAdjacentElement(LogicalDirection direction) 130Type ITextPointer.GetElementType(LogicalDirection direction) 198/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 200ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 206/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 208ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 222ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 251ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 266ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 277ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 286ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 367if (!isAtCaretUnitBoundary && ((ITextPointer)this).LogicalDirection == LogicalDirection.Backward) 375ITextPointer positionForwardGravity = ((ITextPointer)this).CreatePointer(LogicalDirection.Forward); 385LogicalDirection ITextPointer.LogicalDirection 451bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 484LogicalDirection gravity = this.ChildPointer.LogicalDirection; 514Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 519bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 524bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 639public static TextPointerContext GetPointerContext(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 650public static int GetTextRunLength(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 658/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 661public static int GetTextInRun(DocumentSequenceTextPointer thisTp, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 690public static object GetAdjacentElement(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 701public static Type GetElementType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 774public static ITextPointer CreatePointer(DocumentSequenceTextPointer thisTp, LogicalDirection gravity) 780/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 782public static ITextPointer CreatePointer(DocumentSequenceTextPointer thisTp, int distance, LogicalDirection gravity) 827internal static bool iScan(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 832moved = xGapAwareScan(thisTp, (direction == LogicalDirection.Forward ? 1 : -1)); 872private static DocumentSequenceTextPointer xGetClingDSTP(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 884if (direction == LogicalDirection.Forward) 897Debug.Assert(direction == LogicalDirection.Backward); 922private static TextPointerContext xGapAwareGetSymbolType(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 929private static object xGapAwareGetEmbeddedElement(DocumentSequenceTextPointer thisTp, LogicalDirection direction) 973if (tp1.ChildPointer.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None || 974tp2.ChildPointer.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.None) 983if (block.ChildContainer.Start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) 1038LogicalDirection scanDir = (distance > 0 ? LogicalDirection.Forward : LogicalDirection.Backward); 1066if (scanDir == LogicalDirection.Backward) 1074if (!((cdb.IsHead && scanDir == LogicalDirection.Backward) 1075|| (cdb.IsTail && scanDir == LogicalDirection.Forward) 1079cdb = (scanDir == LogicalDirection.Forward ? cdb.NextBlock : cdb.PreviousBlock); 1080childTn = (scanDir == LogicalDirection.Forward ?
System\Windows\Documents\DocumentSequenceTextView.cs (5)
82LogicalDirection edge = LogicalDirection.Forward; 213LogicalDirection newEdge = LogicalDirection.Forward; 306internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction)
System\Windows\Documents\FixedDocument.cs (11)
509fixedTextPointer = new FixedTextPointer(true, LogicalDirection.Forward, flowPosition); 1080if (!highlights.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 1082highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1093selected = highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)); 1111highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1114while (highlights.GetHighlightValue(highlightTransitionPosition, LogicalDirection.Forward, typeof(TextSelection)) != DependencyProperty.UnsetValue); 1123LogicalDirection.Forward, typeof(HighlightComponent)) as AnnotationHighlightLayer.HighlightSegment; 1127highlightTransitionPosition = highlights.GetNextHighlightChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 1137this.FixedContainer.GetMultiHighlights((FixedTextPointer)highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), 1138(FixedTextPointer)highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward), 1443return new FixedTextPointer(true, LogicalDirection.Forward, flowPosition);
System\Windows\Documents\FixedElement.cs (6)
271TextPointerContext tpc = pos.GetPointerContext(LogicalDirection.Forward); 274root.AddText(pos.GetTextInRun(LogicalDirection.Forward)); 278root.AddChild(pos.GetAdjacentElement(LogicalDirection.Forward)); 282object obj = pos.GetAdjacentElement(LogicalDirection.Forward); 286pos.MoveToNextContextPosition(LogicalDirection.Forward); 291pos.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\FixedFindEngine.cs (12)
153end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber))); 154start = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Forward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageStartFlowPosition(translatedPageNumber))); 158start = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Forward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageStartFlowPosition(translatedPageNumber))); 159end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber))); 168end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber)); 169start = new FixedTextPointer(false, LogicalDirection.Forward, textBuilder.GetPageStartFlowPosition(pageNumber)); 173start = new FixedTextPointer(false, LogicalDirection.Forward, textBuilder.GetPageStartFlowPosition(pageNumber)); 174end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber)); 306new FixedTextPointer(false, LogicalDirection.Forward,pageStartFlowPosition)); 312firstSearchPageStart = new FixedTextPointer(false, LogicalDirection.Forward, endAsFTP.FixedTextContainer.FixedTextBuilder.GetPageStartFlowPosition(pageNumber)); 326new FixedTextPointer(false, LogicalDirection.Backward, pageEndFlowPosition)); 332firstSearchPageEnd = new FixedTextPointer(false, LogicalDirection.Backward, startAsFTP.FixedTextContainer.FixedTextBuilder.GetPageEndFlowPosition(pageNumber));
System\Windows\Documents\FixedTextBuilder.cs (2)
393internal bool GetFixedPosition(FlowPosition position, LogicalDirection textdir, out FixedPosition fixedp) 427textdir == LogicalDirection.Backward &&
System\Windows\Documents\FixedTextContainer.cs (12)
96ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 102ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 107ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 114return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 117TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 127int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 132object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 147StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 586_start = new FixedTextPointer(false, LogicalDirection.Backward, new FlowPosition(this, this.FixedTextBuilder.FixedFlowMap.FlowStartEdge, 1)); 587_end = new FixedTextPointer(false, LogicalDirection.Forward, new FlowPosition(this, this.FixedTextBuilder.FixedFlowMap.FlowEndEdge, 0)); 596FixedTextPointer eStart = new FixedTextPointer(false, LogicalDirection.Backward, pStart); 597FixedTextPointer eEnd = new FixedTextPointer(false, LogicalDirection.Forward, pEnd);
System\Windows\Documents\FixedTextPointer.cs (27)
38internal FixedTextPointer(bool mutable, LogicalDirection gravity, FlowPosition flow) 100TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 110int ITextPointer.GetTextRunLength(LogicalDirection direction) 121string ITextPointer.GetTextInRun(LogicalDirection direction) 127/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 130int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 150object ITextPointer.GetAdjacentElement(LogicalDirection direction) 165Type ITextPointer.GetElementType(LogicalDirection direction) 266/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 268ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 274/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 276ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 300ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 309ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 327ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 341ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 353ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 373void ITextPointer.SetLogicalDirection(LogicalDirection direction) 383bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 470Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 478bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 486bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 576if (!isAtCaretUnitBoundary && this.LogicalDirection == LogicalDirection.Backward) 584ITextPointer positionForwardGravity = ((ITextPointer)this).CreatePointer(LogicalDirection.Forward); 594LogicalDirection ITextPointer.LogicalDirection 670internal LogicalDirection LogicalDirection 703private LogicalDirection _gravity;
System\Windows\Documents\FixedTextView.cs (43)
83textPos = _CreateTextPointer(fixedp, LogicalDirection.Backward); 107pos = _CreateTextPointer(fixedp, LogicalDirection.Forward); 115pos = _CreateTextPointer(fixedp, LogicalDirection.Forward); 186if (position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None) 346LogicalDirection edge = position.LogicalDirection; 347LogicalDirection scanDir = LogicalDirection.Forward; 368scanDir = LogicalDirection.Backward; 382linesMoved = (scanDir == LogicalDirection.Forward) ? 1 : -1; 407if (scanDir == LogicalDirection.Backward) 514internal override ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction) 531CharacterHit next = (direction == LogicalDirection.Forward) ? 537LogicalDirection edge = LogicalDirection.Forward; 540edge = LogicalDirection.Backward; 618ITextPointer begin = _CreateTextPointer(new FixedPosition(fixedNodes[0], 0), LogicalDirection.Forward); 619ITextPointer end = _CreateTextPointer(new FixedPosition(lastNode, lastIndex), LogicalDirection.Backward); 651(tp.CompareTo(this.Start) == 0 && (tp.LogicalDirection == LogicalDirection.Forward || this.IsContainerStart)) || 652(tp.CompareTo(this.End) == 0 && (tp.LogicalDirection == LogicalDirection.Backward || this.IsContainerEnd)) 746_start = new FixedTextPointer(false, LogicalDirection.Forward, flowStart); 759_end = new FixedTextPointer(false, LogicalDirection.Backward, flowEnd); 798private void _GlyphRunHitTest(Glyphs g, double xoffset, out int charIndex, out LogicalDirection edge) 801edge = LogicalDirection.Forward; 819edge = (hit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward; 862LogicalDirection dir; 876itp = ((ITextPointer)this.Start).CreatePointer(LogicalDirection.Forward); 877itp.MoveToInsertionPosition(LogicalDirection.Forward); 881itp = ((ITextPointer)this.End).CreatePointer(LogicalDirection.Backward); 882itp.MoveToInsertionPosition(LogicalDirection.Backward); 891private bool _GetNextLineGlyphs(ref FixedPosition fixedp, ref LogicalDirection edge, double suggestedX, LogicalDirection scanDir) 896FixedNode[] fixedNodes = Container.FixedTextBuilder.GetNextLine(fixedp.Node, (scanDir == LogicalDirection.Forward), ref count); 1089LogicalDirection textdir = ftp.LogicalDirection; 1103textdir = LogicalDirection.Forward; 1106textdir = LogicalDirection.Backward; 1143LogicalDirection dir = LogicalDirection.Forward; 1147dir = LogicalDirection.Backward; 1176private ITextPointer _CreateTextPointer(FixedPosition fixedPosition, LogicalDirection edge) 1201LogicalDirection edge; 1211LogicalDirection dir = textPointer.LogicalDirection; 1212int increment = (dir == LogicalDirection.Forward ? +1 : -1);
System\Windows\Documents\FlowDocument.cs (1)
1491segmentEnd = args.ITextPosition.CreatePointer(args.Count, LogicalDirection.Forward);
System\Windows\Documents\FlowPosition.cs (30)
166int scan = flowScan._vScan(LogicalDirection.Forward, -1); 176internal TextPointerContext GetPointerContext(LogicalDirection dir) 178Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 184internal int GetTextRunLength(LogicalDirection dir) 189if (dir == LogicalDirection.Forward) 201internal int GetTextInRun(LogicalDirection dir, int maxLength, char[] chars, int startIndex) 210if (dir == LogicalDirection.Forward) 227if (dir == LogicalDirection.Forward) 240internal object GetAdjacentElement(LogicalDirection dir) 273internal FixedElement GetElement(LogicalDirection dir) 289(tst = flowScan.GetPointerContext(LogicalDirection.Backward))!= TextPointerContext.None) 295FlowPosition flowEnd = flowScan.GetClingPosition(LogicalDirection.Backward); 305flowScan.Move(LogicalDirection.Backward); 314LogicalDirection dir = (distance >= 0 ? LogicalDirection.Forward : LogicalDirection.Backward); 336internal bool Move(LogicalDirection dir) 364internal void GetFlowNode(LogicalDirection direction, out FlowNode flowNode, out int offsetStart) 380FlowPosition flowScan = GetClingPosition(LogicalDirection.Forward); 388int scan = flowScan._vScan(LogicalDirection.Forward, distance); 401internal FlowPosition GetClingPosition(LogicalDirection dir) 406if (dir == LogicalDirection.Forward) 428Debug.Assert(dir == LogicalDirection.Backward); 549private int _vScan(LogicalDirection dir, int limit) 558if (dir == LogicalDirection.Forward) 586Debug.Assert(dir == LogicalDirection.Backward); 617private TextPointerContext _vGetSymbolType(LogicalDirection dir) 620if (dir == LogicalDirection.Forward) 636Debug.Assert(dir == LogicalDirection.Backward);
System\Windows\Documents\FrameworkRichTextComposition.cs (4)
49return _ResultStart == null ? null : (TextPointer)_ResultStart.GetFrozenPointer(LogicalDirection.Backward); 60return _ResultEnd == null ? null : (TextPointer)_ResultEnd.GetFrozenPointer(LogicalDirection.Forward); 71return _CompositionStart == null ? null : (TextPointer)_CompositionStart.GetFrozenPointer(LogicalDirection.Backward); 82return _CompositionEnd == null ? null : (TextPointer)_CompositionEnd.GetFrozenPointer(LogicalDirection.Forward);
System\Windows\Documents\FrameworkTextComposition.cs (4)
199_resultStart = start.GetFrozenPointer(LogicalDirection.Backward); 200_resultEnd = end.GetFrozenPointer(LogicalDirection.Forward); 220_compositionStart = start.GetFrozenPointer(LogicalDirection.Backward); 221_compositionEnd = end.GetFrozenPointer(LogicalDirection.Forward);
System\Windows\Documents\HighlightLayer.cs (3)
42internal abstract object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction); 53internal abstract bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction); 65internal abstract StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction);
System\Windows\Documents\Highlights.cs (11)
61internal virtual object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction, Type highlightLayerOwnerType) 94internal virtual bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 119internal virtual StaticTextPointer GetNextHighlightChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 138else if (direction == LogicalDirection.Forward) 176internal virtual StaticTextPointer GetNextPropertyChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 189characterRunEndPosition = textPosition.GetNextContextPosition(LogicalDirection.Forward); 354if (!highlightLayer.IsContentHighlighted(highlightTransitionPosition, LogicalDirection.Forward)) 356highlightTransitionPosition = highlightLayer.GetNextChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 364highlightTransitionPosition = highlightLayer.GetNextChangePosition(highlightTransitionPosition, LogicalDirection.Forward); 367ranges.Add(new TextSegment(highlightRangeStart.CreateDynamicTextPointer(LogicalDirection.Forward), highlightTransitionPosition.CreateDynamicTextPointer(LogicalDirection.Forward)));
System\Windows\Documents\Hyperlink.cs (2)
111Hyperlink hyperlink = navigator.GetAdjacentElement(LogicalDirection.Forward) as Hyperlink; 119navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\ImmComposition.cs (25)
648caretNavigator = _caretOffset > 0 ? _startComposition.CreatePointer(_caretOffset, LogicalDirection.Forward) : _endComposition; 655ITextPointer startPosition = startNavigator.CreatePointer(LogicalDirection.Forward); 656ITextPointer endPosition = endNavigator.CreatePointer(LogicalDirection.Backward); 657ITextPointer caretPosition = caretNavigator.CreatePointer(LogicalDirection.Forward); 777rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 1145start = range.Start.CreatePointer(resultLength, LogicalDirection.Forward); 1149ITextPointer caretPosition = _caretOffset >= 0 ? start.CreatePointer(_caretOffset, LogicalDirection.Forward) : end; 1188ITextPointer startAttribute = _startComposition.CreatePointer(startOffset, LogicalDirection.Backward); 1189ITextPointer endAttribute = _startComposition.CreatePointer(i + 1, LogicalDirection.Forward); 1419switch (navigator.GetPointerContext(LogicalDirection.Backward)) 1423int copied = navigator.GetTextInRun(LogicalDirection.Backward, buffer, 0, buffer.Length); 1437if (!navigator.GetElementType(LogicalDirection.Backward).IsSubclassOf(typeof(Inline))) 1441navigator.MoveToNextContextPosition(LogicalDirection.Backward); 1450navigator.MoveToNextContextPosition(LogicalDirection.Backward); 1471switch (navigator.GetPointerContext(LogicalDirection.Forward)) 1475int copied = navigator.GetTextInRun(LogicalDirection.Forward, buffer, 0, buffer.Length); 1488if (!navigator.GetElementType(LogicalDirection.Forward).IsSubclassOf(typeof(Inline))) 1492navigator.MoveToNextContextPosition(LogicalDirection.Forward); 1500navigator.MoveToNextContextPosition(LogicalDirection.Forward); 1543ITextPointer start = range.Start.CreatePointer(LogicalDirection.Backward); 1548ITextPointer end = start.CreatePointer(LogicalDirection.Forward); 1570switch (position.GetPointerContext(LogicalDirection.Backward)) 1586switch (position.GetPointerContext(LogicalDirection.Forward)) 1673positionNext.MoveToNextInsertionPosition(LogicalDirection.Forward); 1677positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward);
System\Windows\Documents\InlineUIContainer.cs (1)
107return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement;
System\Windows\Documents\ITextContainer.cs (7)
38ITextPointer CreatePointerAtOffset(int offset, LogicalDirection direction); 43ITextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction); 45ITextPointer CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction); 49TextPointerContext GetPointerContext(StaticTextPointer pointer, LogicalDirection direction); 53int GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count); 55object GetAdjacentElement(StaticTextPointer position, LogicalDirection direction); 61StaticTextPointer GetNextContextPosition(StaticTextPointer position, LogicalDirection direction);
System\Windows\Documents\ITextPointer.cs (19)
35ITextPointer CreatePointer(LogicalDirection gravity); 38ITextPointer CreatePointer(int offset, LogicalDirection gravity); 41void SetLogicalDirection(LogicalDirection direction); 54TextPointerContext GetPointerContext(LogicalDirection direction); 60int GetTextRunLength(LogicalDirection direction); 63string GetTextInRun(LogicalDirection direction); 66int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count); 73object GetAdjacentElement(LogicalDirection direction); 82bool MoveToNextContextPosition(LogicalDirection direction); 85ITextPointer GetNextContextPosition(LogicalDirection direction); 88bool MoveToInsertionPosition(LogicalDirection direction); 91ITextPointer GetInsertionPosition(LogicalDirection direction); 94ITextPointer GetFormatNormalizedPosition(LogicalDirection direction); 97bool MoveToNextInsertionPosition(LogicalDirection direction); 100ITextPointer GetNextInsertionPosition(LogicalDirection direction); 109Rect GetCharacterRect(LogicalDirection direction); 115ITextPointer GetFrozenPointer(LogicalDirection logicalDirection); 125Type GetElementType(LogicalDirection direction); 175LogicalDirection LogicalDirection { get; }
System\Windows\Documents\ITextSelection.cs (3)
68void SetCaretToPosition(ITextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace); 79bool ExtendToNextInsertionPosition(LogicalDirection direction); 138bool ExtendToNextTableRow(LogicalDirection direction);
System\Windows\Documents\ITextView.cs (1)
276ITextPointer GetNextCaretUnitPosition(ITextPointer position, LogicalDirection direction);
System\Windows\Documents\List.cs (5)
194if (textNav.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 196DependencyObject element = textNav.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 214textNav.MoveToNextContextPosition(LogicalDirection.Forward); 250listItem = block.ElementStart.GetAdjacentElement(LogicalDirection.Backward) as ListItem; 278block = block == lastBlock ? null : (Block)listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward);
System\Windows\Documents\NullTextContainer.cs (10)
39_start = new NullTextPointer(this, LogicalDirection.Backward); 40_end = new NullTextPointer(this, LogicalDirection.Forward); 84ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 90ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 95ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 102return new StaticTextPointer(this, ((ITextContainer)this).CreatePointerAtOffset(offset, LogicalDirection.Forward)); 105TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 115int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 120object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 135StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction)
System\Windows\Documents\NullTextNavigator.cs (25)
32internal NullTextPointer(NullTextContainer container, LogicalDirection gravity) 74TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 84int ITextPointer.GetTextRunLength(LogicalDirection direction) 91/// <see cref="ITextPointer.GetTextInRun(LogicalDirection)"/> 93string ITextPointer.GetTextInRun(LogicalDirection direction) 99/// <see cref="ITextPointer.GetTextInRun(LogicalDirection,char[],int,int)"/> 102int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 112object ITextPointer.GetAdjacentElement(LogicalDirection direction) 122Type ITextPointer.GetElementType(LogicalDirection direction) 186/// <see cref="ITextPointer.CreatePointer(LogicalDirection)"/> 188ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 194/// <see cref="ITextPointer.CreatePointer(int,LogicalDirection)"/> 196ITextPointer ITextPointer.CreatePointer(int distance, LogicalDirection gravity) 212ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 225void ITextPointer.SetLogicalDirection(LogicalDirection direction) 236bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 289Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 298bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 306bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 331ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 349ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 363ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 375ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 457LogicalDirection ITextPointer.LogicalDirection 513private LogicalDirection _gravity;
System\Windows\Documents\Paragraph.cs (2)
253TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 261navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\RangeContentEnumerator.cs (13)
104switch (_navigator.GetPointerContext(LogicalDirection.Forward)) 112runLength = _navigator.GetTextRunLength(LogicalDirection.Forward); 114_navigator.GetTextInRun(LogicalDirection.Forward, _buffer, offset, runLength); 116_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 118while (_navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 126_currentCache = _navigator.GetAdjacentElement(LogicalDirection.Forward); 129_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 134_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 180switch (_navigator.GetPointerContext(LogicalDirection.Forward)) 187_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 189while (_navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text && _navigator.CompareTo(_end) < 0); 194_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 199_navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\RubberbandSelector.cs (1)
339return new FixedTextPointer(false, LogicalDirection.Forward, flowHit);
System\windows\Documents\SelectionWordBreaker.cs (2)
48internal static bool IsAtWordBoundary(char[] text, int position, LogicalDirection insideWordDirection) 53if (insideWordDirection == LogicalDirection.Backward)
System\Windows\Documents\Span.cs (4)
224if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 226position = position.GetNextContextPosition(LogicalDirection.Backward); 228else if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 230position = position.GetNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\Speller.cs (46)
111internal SpellingError GetError(ITextPointer position, LogicalDirection direction, bool forceEvaluation) 145internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, LogicalDirection direction) 194ExpandToWordBreakAndContext(error.Start, LogicalDirection.Backward, language, out ITextPointer contentStart, out ITextPointer contextStart); 195ExpandToWordBreakAndContext(error.End, LogicalDirection.Forward, language, out ITextPointer contentEnd, out ITextPointer contextEnd); 240if (_statusTable.GetError(pointer, LogicalDirection.Forward, out errorStart, out errorEnd)) 250pointer = _statusTable.GetNextErrorTransition(pointer, LogicalDirection.Forward); 670end = GetNextLanguageTransition(start, LogicalDirection.Forward, language, end); 711wordBreakLeft = SearchForWordBreaks(caretPosition, LogicalDirection.Backward, language, 1, false /* stopOnError */); 712wordBreakRight = SearchForWordBreaks(caretPosition, LogicalDirection.Forward, language, 1, false /* stopOnError */); 727FindPositionInSegmentList(textMap, LogicalDirection.Backward, segments, out leftBreakOffset, out rightBreakOffset); 797ExpandToWordBreakAndContext(start, LogicalDirection.Backward, language, out contentStart, out contextStart); 798ExpandToWordBreakAndContext(end, LogicalDirection.Forward, language, out contentEnd, out contextEnd); 1089private void ExpandToWordBreakAndContext(ITextPointer position, LogicalDirection direction, XmlLanguage language, 1099LogicalDirection inwardDirection; 1125inwardDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 1131if (direction == LogicalDirection.Backward) 1166if (direction == LogicalDirection.Backward) 1183if (direction == LogicalDirection.Backward) 1210if (direction == LogicalDirection.Backward) 1239private int FindPositionInSegmentList(TextMap textMap, LogicalDirection direction, ArrayList segments, 1298if (direction == LogicalDirection.Backward) 1319private ITextPointer SearchForWordBreaks(ITextPointer position, LogicalDirection direction, XmlLanguage language, int minWordCount, bool stopOnError) 1337closestErrorPosition = nextErrorTransition.CreateDynamicTextPointer(LogicalDirection.Forward); 1345searchPosition.MoveByOffset(direction == LogicalDirection.Backward ? -ContextBlockSize : +ContextBlockSize); 1350if (direction == LogicalDirection.Backward && closestErrorPosition.CompareTo(searchPosition) > 0 || 1351direction == LogicalDirection.Forward && closestErrorPosition.CompareTo(searchPosition) < 0) 1361if (direction == LogicalDirection.Backward && closestLanguageTransition.CompareTo(searchPosition) > 0 || 1362direction == LogicalDirection.Forward && closestLanguageTransition.CompareTo(searchPosition) < 0) 1368if (direction == LogicalDirection.Backward) 1391private ITextPointer GetNextLanguageTransition(ITextPointer position, LogicalDirection direction, XmlLanguage language, ITextPointer haltPosition) 1395while ((direction == LogicalDirection.Forward && navigator.CompareTo(haltPosition) < 0) || 1396(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) > 0)) 1405if ((direction == LogicalDirection.Forward && navigator.CompareTo(haltPosition) > 0) || 1406(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) < 0)) 1468private void ScanPosition(ITextPointer position, LogicalDirection direction) 1473if (direction == LogicalDirection.Forward) 1662_basePosition = contextStart.GetFrozenPointer(LogicalDirection.Backward); 1689switch (position.GetPointerContext(LogicalDirection.Forward)) 1692runCount = position.GetTextRunLength(LogicalDirection.Forward); 1696position.GetTextInRun(LogicalDirection.Forward, _text, _textLength, runCount); 1732position.MoveToNextContextPosition(LogicalDirection.Forward); 1740position.MoveToNextContextPosition(LogicalDirection.Forward); 1807context = pointer.GetPointerContext(LogicalDirection.Forward); 1810TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Forward)))
System\Windows\Documents\SpellerError.cs (2)
35_start = start.GetFrozenPointer(LogicalDirection.Forward); 36_end = end.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\SpellerHighlightLayer.cs (3)
55internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 72internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 79internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction)
System\Windows\Documents\SpellerStatusTable.cs (20)
93for (index = FindIndex(searchStart.CreateStaticPointer(), LogicalDirection.Forward); index >= 0 && index < _runList.Count; index++) 129runIndex = FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); 165internal bool IsRunType(StaticTextPointer textPosition, LogicalDirection direction, RunType runType) 180internal StaticTextPointer GetNextErrorTransition(StaticTextPointer textPosition, LogicalDirection direction) 195else if (direction == LogicalDirection.Forward) 245internal bool GetError(StaticTextPointer textPosition, LogicalDirection direction, 265internal bool GetRun(StaticTextPointer position, LogicalDirection direction, out RunType runType, out StaticTextPointer end) 280end = (direction == LogicalDirection.Forward) ? GetRunEndPosition(index) : run.Position.CreateStaticPointer(); 310private int GetErrorIndex(StaticTextPointer textPosition, LogicalDirection direction) 333private int FindIndex(StaticTextPointer position, LogicalDirection direction) 350if (direction == LogicalDirection.Forward && position.CompareTo(run.Position) < 0 || 351direction == LogicalDirection.Backward && position.CompareTo(run.Position) <= 0) 356else if (direction == LogicalDirection.Forward && position.CompareTo(GetRunEndPosition(index)) >= 0 || 357direction == LogicalDirection.Backward && position.CompareTo(GetRunEndPosition(index)) > 0) 393startIndex = FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); 394endIndex = FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); 429endIndex = FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); 594index = FindIndex(position.CreateStaticPointer(), LogicalDirection.Backward); 753return GetRunEndPosition(index).CreateDynamicTextPointer(LogicalDirection.Forward); 801_position = position.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\StaticTextPointer.cs (5)
49internal ITextPointer CreateDynamicTextPointer(LogicalDirection direction) 56internal TextPointerContext GetPointerContext(LogicalDirection direction) 70internal int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 77internal object GetAdjacentElement(LogicalDirection direction) 91internal StaticTextPointer GetNextContextPosition(LogicalDirection direction)
System\Windows\Documents\TextContainer.cs (36)
434ITextPointer ITextContainer.CreatePointerAtOffset(int offset, LogicalDirection direction) 442internal TextPointer CreatePointerAtOffset(int offset, LogicalDirection direction) 451ITextPointer ITextContainer.CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 465internal TextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 478ITextPointer ITextContainer.CreateDynamicTextPointer(StaticTextPointer position, LogicalDirection direction) 505TextPointerContext ITextContainer.GetPointerContext(StaticTextPointer pointer, LogicalDirection direction) 516else if (direction == LogicalDirection.Forward) 518edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 523edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward); 555int ITextContainer.GetTextInRun(StaticTextPointer position, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 571object ITextContainer.GetAdjacentElement(StaticTextPointer position, LogicalDirection direction) 618StaticTextPointer ITextContainer.GetNextContextPosition(StaticTextPointer position, LogicalDirection direction) 635edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd; 641TextTreeTextNode nextTextNode = ((direction == LogicalDirection.Forward) ? node.GetNextNode() : node.GetPreviousNode()) as TextTreeTextNode; 646edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd; 650else if (direction == LogicalDirection.Forward) 652edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 657edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward); 829LogicalDirection direction; 863originalPosition = this.HasListeners ? new TextPointer(position, LogicalDirection.Backward) : null; 875direction = LogicalDirection.Backward; 879direction = LogicalDirection.Forward; 888if ((direction == LogicalDirection.Backward && textNode.AfterEndReferenceCount) || 889(direction == LogicalDirection.Forward && textNode.BeforeStartReferenceCount)) 1049newFirstIMEVisibleNode = startPosition.GetAdjacentTextElementNodeSibling(LogicalDirection.Forward); 1271deletePosition = new TextPointer(startPosition, LogicalDirection.Forward); 1597if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward) 1605TextPointer positionForwardGravity = position.GetPositionAtOffset(0, LogicalDirection.Forward); 1640startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward); 1671endPosition = new TextPointer(this, _rootNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 2437node = startPosition.GetAdjacentSiblingNode(LogicalDirection.Forward); 2438stopNode = endPosition.GetAdjacentSiblingNode(LogicalDirection.Forward); 2793startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward); 2798endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward); 3422TextElement adjacentElement = startPosition.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 3425nextIMEVisibleNode = (TextTreeTextElementNode)endPosition.GetAdjacentSiblingNode(LogicalDirection.Forward);
System\Windows\Documents\TextContainerChangeEventArgs.cs (1)
34_textPosition = textPosition.GetFrozenPointer(LogicalDirection.Forward);
System\windows\Documents\TextEditor.cs (5)
413internal SpellingError GetSpellingErrorAtPosition(ITextPointer position, LogicalDirection direction) 425internal ITextPointer GetNextSpellingErrorPosition(ITextPointer position, LogicalDirection direction) 1218string textAdjacent = textContainer.TextSelection.AnchorPosition.GetTextInRun(LogicalDirection.Backward); 1515if (cursorPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null && 1519lastCharacterRect = cursorPosition.GetCharacterRect(LogicalDirection.Backward);
System\windows\Documents\TextEditorContextMenu.cs (7)
172LogicalDirection direction; 183direction = LogicalDirection.Backward; 191direction = LogicalDirection.Forward; 195direction = LogicalDirection.Forward; 261private static void GetClippedPositionOffsets(TextEditor This, ITextPointer position, LogicalDirection direction, 402while (position.GetAdjacentElement(LogicalDirection.Forward) is Inline) 404position = position.GetNextContextPosition(LogicalDirection.Forward);
System\windows\Documents\TextEditorCopyPaste.cs (3)
411This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 962start = start.GetPositionAtOffset(0, LogicalDirection.Backward); 963TextPointer end = start.GetPositionAtOffset(0, LogicalDirection.Forward);
System\windows\Documents\TextEditorDragDrop.cs (5)
481!TextPointerBase.IsAtWordBoundary(dropPosition, /*insideWordDirection:*/LogicalDirection.Forward) && 484TextPointerBase.IsAtWordBoundary(_dragSourceTextRange.Start, LogicalDirection.Forward) && // 485TextPointerBase.IsAtWordBoundary(_dragSourceTextRange.End, LogicalDirection.Forward)) 565selection.SetCaretToPosition(dropPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 593selection.SetCaretToPosition(dropPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true);
System\windows\Documents\TextEditorMouse.cs (6)
575if (snappedCursorPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null && 579Rect lastCharacterRect = snappedCursorPosition.GetCharacterRect(LogicalDirection.Backward); 749LogicalDirection otherEdgeDirection = (mouseMovePosition.LogicalDirection == LogicalDirection.Forward) ? 750LogicalDirection.Backward : LogicalDirection.Forward;
System\windows\Documents\TextEditorSelection.cs (91)
128ITextPointer lineStart = position.CreatePointer(LogicalDirection.Forward); 130ITextPointer lineEnd = position.CreatePointer(LogicalDirection.Backward); 203LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 219LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 236LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 252LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 328ITextPointer nextPosition = lineEndPosition.GetNextInsertionPosition(LogicalDirection.Forward); 418ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward); 479if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Forward)) 483This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 488This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 532This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 537if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward)) 541This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 818ITextPointer caretPosition = lineRange.Start.GetFrozenPointer(LogicalDirection.Forward); 821This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 867LogicalDirection orientation = TextPointerBase.IsNextToPlainLineBreak(lineRange.End, LogicalDirection.Backward) ? LogicalDirection.Forward : LogicalDirection.Backward; 901This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 930This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 961LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 977LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 993LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward; 1009LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward; 1027if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1085ITextPointer nextPosition = lineEndPosition.GetNextInsertionPosition(LogicalDirection.Forward); 1137if (TextPointerBase.IsNextToAnyBreak(newMovingPosition, LogicalDirection.Forward) || 1138newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null) 1147newMovingPosition = newMovingPosition.GetInsertionPosition(LogicalDirection.Forward); 1148newMovingPosition = newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward); 1157newMovingPosition = newMovingPosition.GetFrozenPointer(LogicalDirection.Backward); 1175if (newMovingPosition.GetNextInsertionPosition(LogicalDirection.Forward) == null) 1199if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1275ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward); 1336if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Forward)) 1384if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward)) 1618ExtendSelectionAndBringIntoView(lineRange.Start.CreatePointer(LogicalDirection.Forward), This); 1670if (TextPointerBase.IsNextToPlainLineBreak(destination, LogicalDirection.Forward) || 1671TextPointerBase.IsNextToRichLineBreak(destination, LogicalDirection.Forward)) 1680destination = destination.GetNextInsertionPosition(LogicalDirection.Forward); 1684else if (TextPointerBase.IsNextToParagraphBreak(destination, LogicalDirection.Forward) && 1685TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1689ITextPointer newDestination = destination.GetNextInsertionPosition(LogicalDirection.Forward); 1703destination = destination.GetFrozenPointer(LogicalDirection.Backward); 2052private static void MoveToCharacterLogicalDirection(TextEditor textEditor, LogicalDirection direction, bool extend) 2072ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2082LogicalDirection contentDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 2113private static void NavigateWordLogicalDirection(TextEditor textEditor, LogicalDirection direction) 2130if (direction == LogicalDirection.Forward) 2133if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2136textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2143TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Forward); 2145textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2153if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2156textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2163TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward); 2165textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2188private static void ExtendWordLogicalDirection(TextEditor textEditor, LogicalDirection direction) 2209wordBoundary.SetLogicalDirection(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward); 2321movingPosition.LogicalDirection == LogicalDirection.Backward && 2323TextPointerBase.IsNextToAnyBreak(movingPosition, LogicalDirection.Backward)) 2325movingPosition = movingPosition.GetNextInsertionPosition(LogicalDirection.Backward); 2329if (TextPointerBase.IsNextToPlainLineBreak(movingPosition, LogicalDirection.Backward)) 2331movingPosition = movingPosition.GetFrozenPointer(LogicalDirection.Forward); 2348return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2411ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2414This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2427ITextPointer cellEnd = position.GetNextInsertionPosition(LogicalDirection.Backward);
System\windows\Documents\TextEditorSpelling.cs (22)
37internal static SpellingError GetSpellingErrorAtPosition(TextEditor This, ITextPointer position, LogicalDirection direction) 60LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 68direction = (direction == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 83direction = (direction == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 88direction = LogicalDirection.Forward; 92direction = LogicalDirection.Backward; 102internal static ITextPointer GetNextSpellingErrorPosition(TextEditor This, ITextPointer position, LogicalDirection direction) 149caretPosition = textStart.CreatePointer(+correctedText.Length, LogicalDirection.Forward); 185textStart = spellingError.Start.CreatePointer(LogicalDirection.Backward); 187textStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 189textStart.MoveToNextContextPosition(LogicalDirection.Forward); 193textEnd.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text) 195textEnd.MoveToNextContextPosition(LogicalDirection.Backward); 198if (textStart.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text || 203Invariant.Assert(textEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 254private static ITextPointer GetNextTextPosition(ITextPointer position, ITextPointer limit, LogicalDirection direction, out char character) 317position = GetNextTextPosition(position, limit, LogicalDirection.Forward, out character);
System\windows\Documents\TextEditorTyping.cs (36)
552ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Forward); 575This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 629ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Backward); 654position = position.GetFrozenPointer(LogicalDirection.Backward); 661position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text) 683This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 691else if (backspacePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text) 700This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 732This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 748LogicalDirection directionOfDelete = position.CompareTo(deletePosition) < 0 ? LogicalDirection.Forward : LogicalDirection.Backward; 755if (directionOfDelete == LogicalDirection.Forward) 782if (directionOfDelete == LogicalDirection.Backward) 819position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 820position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 825while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 832position = position.GetNextContextPosition(LogicalDirection.Backward); 833if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 841position = position.GetNextContextPosition(LogicalDirection.Backward); 852if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart) 858position.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementEnd) 866while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 873if (!(navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 922TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Forward); 981TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward); 1090This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1181This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1353if (HandleTabInTables(This, LogicalDirection.Forward)) 1385if (HandleTabInTables(This, LogicalDirection.Backward)) 1406private static bool HandleTabInTables(TextEditor This, LogicalDirection direction) 1417This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1430if (direction == LogicalDirection.Forward) 1467if (direction == LogicalDirection.Forward) 1565ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1568This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
System\Windows\Documents\TextEffectResolver.cs (4)
105while (navigator.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text 106&& navigator.MoveToNextContextPosition(LogicalDirection.Forward)) ; 115while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text 117&& navigator.MoveToNextContextPosition(LogicalDirection.Forward)) ;
System\Windows\Documents\TextElement.cs (7)
303TextPointer contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward); 306TextPointer contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 329elementStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward); 362contentStart = new TextPointer(tree, _textElementNode, ElementEdge.AfterStart, LogicalDirection.Backward); 395contentEnd = new TextPointer(tree, _textElementNode, ElementEdge.BeforeEnd, LogicalDirection.Forward); 436elementEnd = new TextPointer(tree, _textElementNode, ElementEdge.AfterEnd, LogicalDirection.Backward); 1009beforeStart = new TextPointer(tree, _textElementNode, ElementEdge.BeforeStart, LogicalDirection.Forward);
System\Windows\Documents\TextElementEnumerator.cs (3)
136_navigator.MoveToNextContextPosition(LogicalDirection.Forward); 141Invariant.Assert(_navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, 145_navigator.MoveToNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\TextFindEngine.cs (17)
193LogicalDirection direction; 202direction = LogicalDirection.Backward; 207direction = LogicalDirection.Forward; 312hasPreceedingSeparatorChar = HasNeighboringSeparatorChar(oppositeEndPosition, LogicalDirection.Backward); 313hasFollowingSeparatorChar = HasNeighboringSeparatorChar(position, LogicalDirection.Forward); 317hasPreceedingSeparatorChar = HasNeighboringSeparatorChar(position, LogicalDirection.Backward); 318hasFollowingSeparatorChar = HasNeighboringSeparatorChar(oppositeEndPosition, LogicalDirection.Forward); 324private static bool HasNeighboringSeparatorChar(ITextPointer position, LogicalDirection direction) 349LogicalDirection.Forward, 361if (direction == LogicalDirection.Forward) 646LogicalDirection direction, 896private static bool IsAdjacentToFormatElement(ITextPointer pointer, LogicalDirection direction) 903if (direction == LogicalDirection.Forward) 905context = pointer.GetPointerContext(LogicalDirection.Forward); 908TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Forward))) 920context = pointer.GetPointerContext(LogicalDirection.Backward); 923TextSchema.IsFormattingType(pointer.GetElementType(LogicalDirection.Backward)))
System\Windows\Documents\TextMapOffsetErrorLogger.cs (2)
59public TextMapOffsetErrorLogger(LogicalDirection direction, TextMap textMap, ArrayList segments, int positionInSegmentList, int leftWordBreak, int rightWordBreak, int contentOffset) 146/// string representation of a <see cref="LogicalDirection"/> instance.
System\Windows\Documents\TextParentUndoUnit.cs (4)
212private readonly LogicalDirection _undoAnchorPositionDirection; 215private readonly LogicalDirection _undoMovingPositionDirection; 218private LogicalDirection _redoAnchorPositionDirection; 221private LogicalDirection _redoMovingPositionDirection;
System\Windows\Documents\TextPointer.cs (97)
276internal TextPointer(TextPointer position, LogicalDirection direction) 282internal TextPointer(TextPointer position, int offset, LogicalDirection direction) 288internal TextPointer(TextContainer textContainer, int offset, LogicalDirection direction) 306Initialize(tree, node, edge, LogicalDirection.Forward, tree.PositionGeneration, false, false, tree.LayoutGeneration); 310internal TextPointer(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection direction) 322internal TextPointer CreatePointer(LogicalDirection gravity) 501/// is <see cref="System.Windows.Documents.LogicalDirection.Backward"/>, or if it is positioned 503/// <see cref="System.Windows.Documents.LogicalDirection.Forward"/>.</para> 544public TextPointerContext GetPointerContext(LogicalDirection direction) 552return (direction == LogicalDirection.Forward) ? GetPointerContextForward(_node, this.Edge) : GetPointerContextBackward(_node, this.Edge); 566public int GetTextRunLength(LogicalDirection direction) 587if (direction == LogicalDirection.Forward) 603textNode = ((direction == LogicalDirection.Forward) ? textNode.GetNextNode() : textNode.GetPreviousNode()) as TextTreeTextNode; 737public string GetTextInRun(LogicalDirection direction) 775public int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 809public DependencyObject GetAdjacentElement(LogicalDirection direction) 902public TextPointer GetPositionAtOffset(int offset, LogicalDirection direction) 990public TextPointer GetNextContextPosition(LogicalDirection direction) 1063public TextPointer GetInsertionPosition(LogicalDirection direction) 1071return GetInsertionPosition(LogicalDirection.Forward); 1090/// "insertion position" in the <see cref="TextPointer.GetInsertionPosition(LogicalDirection)"/> 1130public TextPointer GetNextInsertionPosition(LogicalDirection direction) 1227position.SetLogicalDirection(LogicalDirection.Forward); 1248public Rect GetCharacterRect(LogicalDirection direction) 1330LogicalDirection direction = count < 0 ? LogicalDirection.Backward : LogicalDirection.Forward; 1535public LogicalDirection LogicalDirection 1615TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1619TextSchema.IsFormattingType(position.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1621position.MoveToNextContextPosition(LogicalDirection.Backward); 1622backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1750internal static int GetTextInRun(TextContainer textContainer, int symbolOffset, TextTreeTextNode textNode, int nodeOffset, LogicalDirection direction, char[] textBuffer, int startIndex, int count) 1782skipCount = (direction == LogicalDirection.Forward) ? nodeOffset : textNode.SymbolCount - nodeOffset; 1799textNode = ((direction == LogicalDirection.Forward) ? textNode.GetNextNode() : textNode.GetPreviousNode()) as TextTreeTextNode; 1803if (direction == LogicalDirection.Backward) 1816internal static DependencyObject GetAdjacentElement(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 1972internal bool MoveToNextContextPosition(LogicalDirection direction) 1985if (direction == LogicalDirection.Forward) 2032internal bool MoveToInsertionPosition(LogicalDirection direction) 2075internal bool MoveToNextInsertionPosition(LogicalDirection direction) 2168internal TextElement GetAdjacentElementFromOuterPosition(LogicalDirection direction) 2186internal void SetLogicalDirection(LogicalDirection direction) 2339internal TextPointer GetFrozenPointer(LogicalDirection logicalDirection) 2348void ITextPointer.SetLogicalDirection(LogicalDirection direction) 2388TextPointerContext ITextPointer.GetPointerContext(LogicalDirection direction) 2393int ITextPointer.GetTextRunLength(LogicalDirection direction) 2399string ITextPointer.GetTextInRun(LogicalDirection direction) 2404int ITextPointer.GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) 2409object ITextPointer.GetAdjacentElement(LogicalDirection direction) 2414Type ITextPointer.GetElementType(LogicalDirection direction) 2451ITextPointer ITextPointer.GetNextContextPosition(LogicalDirection direction) 2466ITextPointer ITextPointer.GetInsertionPosition(LogicalDirection direction) 2477ITextPointer ITextPointer.GetFormatNormalizedPosition(LogicalDirection direction) 2486ITextPointer ITextPointer.GetNextInsertionPosition(LogicalDirection direction) 2580ITextPointer ITextPointer.CreatePointer(LogicalDirection gravity) 2585ITextPointer ITextPointer.CreatePointer(int offset, LogicalDirection gravity) 2596ITextPointer ITextPointer.GetFrozenPointer(LogicalDirection logicalDirection) 2602bool ITextPointer.MoveToNextContextPosition(LogicalDirection direction) 2659Rect ITextPointer.GetCharacterRect(LogicalDirection direction) 2664bool ITextPointer.MoveToInsertionPosition(LogicalDirection direction) 2669bool ITextPointer.MoveToNextInsertionPosition(LogicalDirection direction) 2679internal bool MoveToCaretPosition(LogicalDirection contentDirection) 2682LogicalDirection oppositeDirection; 2703oppositeDirection = (contentDirection == LogicalDirection.Forward) ? LogicalDirection.Backward : LogicalDirection.Forward; 2714internal bool MoveToNextCaretPosition(LogicalDirection direction) 2815internal TextTreeTextNode GetAdjacentTextNodeSibling(LogicalDirection direction) 2822internal static TextTreeTextNode GetAdjacentTextNodeSibling(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 2829internal TextTreeTextElementNode GetAdjacentTextElementNodeSibling(LogicalDirection direction) 2836internal TextTreeTextElementNode GetAdjacentTextElementNode(LogicalDirection direction) 2843internal TextTreeNode GetAdjacentSiblingNode(LogicalDirection direction) 2850internal static TextTreeNode GetAdjacentSiblingNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 2854if (direction == LogicalDirection.Forward) 3010if (GetGravityInternal() == LogicalDirection.Forward) 3441symbolType = node.GetPointerContext(LogicalDirection.Forward); 3448symbolType = firstContainedNode.GetPointerContext(LogicalDirection.Forward); 3466symbolType = nextNode.GetPointerContext(LogicalDirection.Forward); 3498symbolType = previousNode.GetPointerContext(LogicalDirection.Backward); 3518symbolType = lastChildNode.GetPointerContext(LogicalDirection.Backward); 3527symbolType = node.GetPointerContext(LogicalDirection.Backward); 3678LogicalDirection ITextPointer.LogicalDirection 3893private void InitializeOffset(TextPointer position, int distance, LogicalDirection direction) 3930private void Initialize(TextContainer tree, TextTreeNode node, ElementEdge edge, LogicalDirection gravity, uint generation, 3990private static void RepositionForGravity(ref TextTreeNode node, ref ElementEdge edge, LogicalDirection gravity) 4001if (gravity == LogicalDirection.Backward) 4014if (gravity == LogicalDirection.Forward) 4027if (gravity == LogicalDirection.Backward) 4040if (gravity == LogicalDirection.Forward) 4058private LogicalDirection GetGravityInternal() 4060return (this.Edge == ElementEdge.BeforeStart || this.Edge == ElementEdge.BeforeEnd) ? LogicalDirection.Forward : LogicalDirection.Backward; 4073internal TextTreeNode GetAdjacentNode(LogicalDirection direction) 4078internal static TextTreeNode GetAdjacentNode(TextTreeNode node, ElementEdge edge, LogicalDirection direction) 4122private TextElement GetElement(LogicalDirection direction) 4141if (GetGravityInternal() == LogicalDirection.Forward)
System\Windows\Documents\TextPointerBase.cs (111)
58internal static string GetTextInRun(ITextPointer position, LogicalDirection direction) 76internal static int GetTextWithLimit(ITextPointer thisPointer, LogicalDirection direction, char[] textBuffer, int startIndex, int count, ITextPointer limit) 85else if (direction == LogicalDirection.Forward && limit.CompareTo(thisPointer) <= 0) 90else if (direction == LogicalDirection.Backward && limit.CompareTo(thisPointer) >= 0) 102if (direction == LogicalDirection.Forward) 184Type forwardType = forwardPosition.GetElementType(LogicalDirection.Forward); 185Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward); 188TextPointerContext forwardContext = forwardPosition.GetPointerContext(LogicalDirection.Forward); 189TextPointerContext backwardContext = backwardPosition.GetPointerContext(LogicalDirection.Backward); 230TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 231TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 254TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 255TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 259typeof(Table).IsAssignableFrom(position.GetElementType(LogicalDirection.Forward))); 272position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 278position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd; 323BorderingElementCategory category = GetBorderingElementCategory(navigator, LogicalDirection.Forward); 330navigator.MoveToNextContextPosition(LogicalDirection.Forward); 332while (GetBorderingElementCategory(navigator, LogicalDirection.Forward) == BorderingElementCategory.MergeableScopingInline); 338elementType = navigator.GetElementType(LogicalDirection.Forward); 342navigator.MoveToNextContextPosition(LogicalDirection.Forward); 359elementType = navigator.GetElementType(LogicalDirection.Forward); 362navigator.MoveToNextInsertionPosition(LogicalDirection.Forward); 375navigator.MoveToNextContextPosition(LogicalDirection.Forward); 377while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 388return IsAtNonMergeableInlineEdge(position, LogicalDirection.Backward); 394return IsAtNonMergeableInlineEdge(position, LogicalDirection.Forward); 404internal static bool IsAtFormatNormalizedPosition(ITextPointer position, LogicalDirection direction) 409internal static bool IsAtInsertionPosition(ITextPointer position, LogicalDirection direction) 414internal static bool IsAtNormalizedPosition(ITextPointer position, LogicalDirection direction, bool respectCaretUnitBoundaries) 423if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 424position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 469internal static bool IsAtWordBoundary(ITextPointer thisPosition, LogicalDirection insideWordDirection) 512return GetWordRange(thisPosition, LogicalDirection.Forward); 524internal static TextSegment GetWordRange(ITextPointer thisPosition, LogicalDirection direction) 547if (moved && IsAtWordBoundary(thisPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 554MoveToNextWordBoundary(navigator, direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 558if (direction == LogicalDirection.Backward) 567wordStart = RestrictWithinBlock(thisPosition, wordStart, LogicalDirection.Backward); 568wordEnd = RestrictWithinBlock(thisPosition, wordEnd, LogicalDirection.Forward); 573wordStart = wordStart.GetFrozenPointer(LogicalDirection.Backward); 574wordEnd = wordEnd.GetFrozenPointer(LogicalDirection.Forward); 578wordStart = wordEnd.GetFrozenPointer(LogicalDirection.Backward); 586private static ITextPointer RestrictWithinBlock(ITextPointer position, ITextPointer limit, LogicalDirection direction) 588Invariant.Assert(!(direction == LogicalDirection.Backward) || position.CompareTo(limit) >= 0, "for backward direction position must be >= than limit"); 589Invariant.Assert(!(direction == LogicalDirection.Forward) || position.CompareTo(limit) <= 0, "for forward direcion position must be <= than linit"); 591while (direction == LogicalDirection.Backward ? position.CompareTo(limit) > 0 : position.CompareTo(limit) < 0) 612return limit.GetInsertionPosition(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward); 621internal static bool IsNextToPlainLineBreak(ITextPointer thisPosition, LogicalDirection direction) 631(direction == LogicalDirection.Backward && IsCharUnicodeNewLine(textBuffer[1])) 633(direction == LogicalDirection.Forward && IsCharUnicodeNewLine(textBuffer[0])) 649internal static bool IsNextToRichLineBreak(ITextPointer thisPosition, LogicalDirection direction) 658internal static bool IsNextToParagraphBreak(ITextPointer thisPosition, LogicalDirection direction) 669internal static bool IsNextToAnyBreak(ITextPointer thisPosition, LogicalDirection direction) 699bool isAtLineWrappingPosition = position.LogicalDirection == LogicalDirection.Forward 714thisPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 715thisPosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart; 725return thisPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.None && 726thisPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 727!typeof(Inline).IsAssignableFrom(thisPosition.GetElementType(LogicalDirection.Backward)); 741while (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 747pointer = pointer.GetNextContextPosition(LogicalDirection.Backward); 779paragraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 856internal static Rect GetCharacterRect(ITextPointer thisPointer, LogicalDirection direction) 862internal static Rect GetCharacterRect(ITextPointer thisPointer, LogicalDirection direction, bool transformToUiScope) 923internal static bool MoveToFormatNormalizedPosition(ITextPointer thisNavigator, LogicalDirection direction) 936internal static bool MoveToInsertionPosition(ITextPointer thisNavigator, LogicalDirection direction) 959internal static bool MoveToNextInsertionPosition(ITextPointer thisNavigator, LogicalDirection direction) 965int increment = direction == LogicalDirection.Forward ? +1 : -1; 982if ((direction == LogicalDirection.Forward && initialPosition.CompareTo(thisNavigator) < 0) || 983(direction == LogicalDirection.Backward && thisNavigator.CompareTo(initialPosition) < 0)) 1013if (direction == LogicalDirection.Backward) 1026while (TextSchema.IsFormattingType(thisNavigator.GetElementType(LogicalDirection.Forward)) 1037if (direction == LogicalDirection.Forward) 1067internal static bool MoveToNextWordBoundary(ITextPointer thisNavigator, LogicalDirection movingDirection) 1088if (IsAtWordBoundary(thisNavigator, /*insideWordDirection:*/LogicalDirection.Forward)) 1099internal static ITextPointer GetFrozenPointer(ITextPointer thisPointer, LogicalDirection logicalDirection) 1138private static bool NormalizePosition(ITextPointer thisNavigator, LogicalDirection direction, bool respectCaretUnitBoundaries) 1144LogicalDirection oppositeDirection; 1148if (direction == LogicalDirection.Forward) 1151oppositeDirection = LogicalDirection.Backward; 1158oppositeDirection = LogicalDirection.Forward; 1254private static int LeaveNonMergeableInlineBoundary(ITextPointer thisNavigator, LogicalDirection direction, int symbolCount) 1258if (direction == LogicalDirection.Forward && IsAtNonMergeableInlineEnd(thisNavigator)) 1260symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Forward); 1264symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward); 1269if (direction == LogicalDirection.Backward && IsAtNonMergeableInlineStart(thisNavigator)) 1271symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward); 1275symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Forward); 1283private static int LeaveNonMergeableAncestor(ITextPointer thisNavigator, LogicalDirection direction) 1286int increment = (direction == LogicalDirection.Forward) ? +1 : -1; 1331TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 1332TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1367if (position.GetTextInRun(LogicalDirection.Backward, neighborhood, 0, 1) == 1 && 1368position.GetTextInRun(LogicalDirection.Forward, neighborhood, 1, 1) == 1) 1426runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount); 1430navigator.GetTextInRun(LogicalDirection.Forward, preceedingText, SelectionWordBreaker.MinContextLength - preceedingCount, runLength); 1436navigator.MoveToInsertionPosition(LogicalDirection.Backward); 1438while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text); 1445runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Forward), SelectionWordBreaker.MinContextLength - followingCount); 1447navigator.GetTextInRun(LogicalDirection.Forward, followingText, followingCount, runLength); 1456navigator.MoveToInsertionPosition(LogicalDirection.Forward); 1458while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 1469private static bool IsAtNonMergeableInlineEdge(ITextPointer position, LogicalDirection direction) 1489private static BorderingElementCategory GetBorderingElementCategory(ITextPointer position, LogicalDirection direction) 1491TextPointerContext context = (direction == LogicalDirection.Forward) ? TextPointerContext.ElementEnd : TextPointerContext.ElementStart; 1515private static bool IsNextToRichBreak(ITextPointer thisPosition, LogicalDirection direction, Type lineBreakType)
System\Windows\Documents\TextRangeBase.cs (68)
77textPointer = textPointer.GetFormatNormalizedPosition(LogicalDirection.Forward); 81textPointer = textPointer.GetFormatNormalizedPosition(LogicalDirection.Backward); 195normalizedPosition.MoveToInsertionPosition(LogicalDirection.Backward); 210!TextPointerBase.IsAtWordBoundary(thisRange.Start, LogicalDirection.Forward) && // 211!TextPointerBase.IsAtWordBoundary(thisRange.Start, LogicalDirection.Backward)) 286!TextPointerBase.IsNextToAnyBreak(thisRange.End, LogicalDirection.Forward)) 292nextPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 305(TextPointerBase.IsNextToAnyBreak(thisRange.End, LogicalDirection.Backward) || 308ITextPointer newEnd = thisRange.End.GetNextInsertionPosition(LogicalDirection.Backward); 336SkipParagraphContent(start, LogicalDirection.Backward); 337SkipParagraphContent(end, LogicalDirection.Forward); 344private static void SkipParagraphContent(ITextPointer navigator, LogicalDirection direction) 353(nextContext == TextPointerContext.ElementStart && direction == LogicalDirection.Forward || // 354nextContext == TextPointerContext.ElementEnd && direction == LogicalDirection.Backward) && // 358(nextContext == TextPointerContext.ElementEnd && direction == LogicalDirection.Forward || // 359nextContext == TextPointerContext.ElementStart && direction == LogicalDirection.Backward) && // 414if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 416moved = position.MoveToNextContextPosition(LogicalDirection.Forward); 420moved = position.MoveToInsertionPosition(LogicalDirection.Forward); 425moved = position.MoveToNextInsertionPosition(LogicalDirection.Forward); 475position.MoveToNextContextPosition(LogicalDirection.Backward)) ; 496moved = position.MoveToNextContextPosition(LogicalDirection.Forward); 519endNavigator.MoveToInsertionPosition(LogicalDirection.Backward); 681TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 697navigator.MoveToNextContextPosition(LogicalDirection.Forward); 707navigator.MoveToNextContextPosition(LogicalDirection.Forward); 712navigator.MoveToNextContextPosition(LogicalDirection.Forward); 715elementType = navigator.GetElementType(LogicalDirection.Forward); 735navigator.MoveToNextContextPosition(LogicalDirection.Forward); 751int runLength = navigator.GetTextRunLength(LogicalDirection.Forward); 753runLength = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, charArray, 0, runLength, endPosition); 755navigator.MoveToNextContextPosition(LogicalDirection.Forward); 765bool theParagraphIsTheFirstInCollection = navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 766navigator.MoveToNextContextPosition(LogicalDirection.Forward); 768TextPointerContext symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 775navigator.MoveToNextContextPosition(LogicalDirection.Forward); 776symbolType = navigator.GetPointerContext(LogicalDirection.Forward); 799List list = (List)navigator.GetAdjacentElement(LogicalDirection.Forward); 820navigator.MoveToNextContextPosition(LogicalDirection.Forward); 830ListItem listItem = (ListItem)navigator.GetAdjacentElement(LogicalDirection.Forward); 862object element = navigator.GetAdjacentElement(LogicalDirection.Forward); 1254while (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1258start = start.GetNextContextPosition(LogicalDirection.Backward); 1314if (thisRange.Start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 1315thisRange.End.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 1361(insertPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.None || 1362insertPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) && 1363(insertPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.None || 1364insertPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd); 1375ITextPointer newStart = insertPosition.GetFrozenPointer(LogicalDirection.Backward); 1376ITextPointer newEnd = insertPosition.CreatePointer(LogicalDirection.Forward); 1381TextPointer insertionPosition = (TextPointer)newStart.CreatePointer(LogicalDirection.Forward); 1419newEnd = newEnd.GetNextInsertionPosition(LogicalDirection.Forward); 1620TextPointerContext context = start.GetPointerContext(LogicalDirection.Forward); 1623start.MoveToNextContextPosition(LogicalDirection.Forward); 1624context = start.GetPointerContext(LogicalDirection.Forward); 1629context = end.GetPointerContext(LogicalDirection.Backward); 1632end.MoveToNextContextPosition(LogicalDirection.Backward); 1633context = end.GetPointerContext(LogicalDirection.Backward); 1637return start.GetAdjacentElement(LogicalDirection.Forward) as UIElement; 1718start = GetNormalizedPosition(thisRange, start, LogicalDirection.Forward); 1725end = GetNormalizedPosition(thisRange, end, LogicalDirection.Backward); 1732if (start.LogicalDirection == LogicalDirection.Backward) 1735start = end.GetFrozenPointer(LogicalDirection.Backward); 1787private static bool IsAtNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction) 1803private static ITextPointer GetNormalizedPosition(ITextRange thisRange, ITextPointer position, LogicalDirection direction) 1961!TextPointerBase.IsAtInsertionPosition(start, LogicalDirection.Forward) || 1962!TextPointerBase.IsAtInsertionPosition(end, LogicalDirection.Backward))
System\Windows\Documents\TextRangeEdit.cs (76)
68if (!keepEmptyFormatting && splitPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 74else if (!keepEmptyFormatting && splitPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 265while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 270while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 280position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 281position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 282(firstInline = position.GetAdjacentElement(LogicalDirection.Backward) as Inline) != null && 283(secondInline = position.GetAdjacentElement(LogicalDirection.Forward) as Inline) != null) 332inline.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 333inline.ElementEnd.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 419if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 460start = start.GetNextContextPosition(LogicalDirection.Forward); 534if (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 541else if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 557Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd, "position must be after ElementEnd"); 558Invariant.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "position must be before ElementStart"); 658while (!(breakPosition.Parent is Paragraph) && breakPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 660breakPosition = breakPosition.GetNextContextPosition(LogicalDirection.Forward); 664breakPosition = breakPosition.GetInsertionPosition(LogicalDirection.Forward); 701return lineBreak.ElementEnd.GetInsertionPosition(LogicalDirection.Forward); 800start = block.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 807TextPointer contentStart = block.ContentStart.GetPositionAtOffset(0, LogicalDirection.Forward); // Normalize forward; 808contentStart = contentStart.GetNextContextPosition(LogicalDirection.Forward); // Leave scope of initial List. 828start = block.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 969TextPointer start = firstChild.ElementStart.GetFrozenPointer(LogicalDirection.Backward); 970TextPointer end = lastChild.ElementEnd.GetFrozenPointer(LogicalDirection.Forward); 977firstChild = (Inline)start.GetAdjacentElement(LogicalDirection.Forward); 978lastChild = (Inline)end.GetAdjacentElement(LogicalDirection.Backward); 1033if (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 1051pointer = pointer.GetNextContextPosition(LogicalDirection.Forward); 1250if (rangeStart.CompareTo(rangeEnd) < 0 && rangeEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 1252rangeEnd = rangeEnd.GetNextInsertionPosition(LogicalDirection.Backward); 1260rangeEnd = rangeEnd.GetInsertionPosition(LogicalDirection.Backward); 1269TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward); 1270TextPointerContext forwardContext = position.GetPointerContext(LogicalDirection.Forward); 1280while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1285while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 1300while (previousPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd && 1301TextSchema.IsMergeableInline(previousPosition.GetAdjacentElement(LogicalDirection.Backward).GetType())) 1303previousPosition = ((Inline)previousPosition.GetAdjacentElement(LogicalDirection.Backward)).ContentEnd; 1309while (nextPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 1310TextSchema.IsMergeableInline(nextPosition.GetAdjacentElement(LogicalDirection.Forward).GetType())) 1312nextPosition = ((Inline)nextPosition.GetAdjacentElement(LogicalDirection.Forward)).ContentStart; 1441while (startPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1442startPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 1580LogicalDirection direction; 1581LogicalDirection oppositeDirection; 1588direction = LogicalDirection.Forward; 1589oppositeDirection = LogicalDirection.Backward; 1597direction = LogicalDirection.Backward; 1598oppositeDirection = LogicalDirection.Forward; 1615Invariant.Assert(direction == LogicalDirection.Forward && nextPosition.CompareTo(end) < 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) > 0, 1627if (direction == LogicalDirection.Forward && nextPosition.CompareTo(end) > 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) < 0) 1641if (direction == LogicalDirection.Forward && nextPosition.CompareTo(end) >= 0 || direction == LogicalDirection.Backward && nextPosition.CompareTo(end) <= 0) 1895TextPointer nextRunPosition = run.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); 1903nextRunPosition = nextRunPosition.GetNextContextPosition(LogicalDirection.Forward); 2055Span parent = (Span)end.GetAdjacentElement(LogicalDirection.Backward); 2085if (pointer.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart && 2086(run = pointer.GetAdjacentElement(LogicalDirection.Forward) as Run) != null) 2100pointer = pointer.GetNextContextPosition(LogicalDirection.Forward); 2112start = start.GetPositionAtOffset(0, LogicalDirection.Forward); 2116start = start.GetNextContextPosition(LogicalDirection.Forward); 2120if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2130start = start.GetNextContextPosition(LogicalDirection.Forward); 2151run = (Run)start.GetAdjacentElement(LogicalDirection.Forward); 2164DependencyObject forwardElement = start.GetAdjacentElement(LogicalDirection.Forward); 2165DependencyObject backwardElement = end.GetAdjacentElement(LogicalDirection.Backward); 2170Inline inline = (Inline)start.GetAdjacentElement(LogicalDirection.Forward); 2189start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2190end.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd && 2191start.GetAdjacentElement(LogicalDirection.Backward) == commonAncestor) 2236if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 2248start = start.GetNextContextPosition(LogicalDirection.Forward);
System\Windows\Documents\TextRangeEditLists.cs (27)
78while (secondParagraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 97TextPointer positionAfterSecondParagraph = secondParagraphOrBlockUIContainer.ElementEnd.GetFrozenPointer(LogicalDirection.Forward); 102TextElement previousBlock = secondParagraphOrBlockUIContainer.ElementStart.GetAdjacentElement(LogicalDirection.Backward) as TextElement; 146ListItem followingListItem = positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart 147? positionAfterSecondParagraph.GetAdjacentElement(LogicalDirection.Forward) as ListItem : null; 150ListItem precedingListItem = positionAfterSecondParagraph.GetAdjacentElement(LogicalDirection.Backward) as ListItem; 154Invariant.Assert(positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 155Invariant.Assert(positionAfterSecondParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd); 176while (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 178navigator.MoveToNextContextPosition(LogicalDirection.Forward); 188while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 190navigator.MoveToNextContextPosition(LogicalDirection.Backward); 211if (mergePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementEnd || 212mergePosition.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.ElementStart) 217List precedingList = mergePosition.GetAdjacentElement(LogicalDirection.Backward) as List; 218List followingList = mergePosition.GetAdjacentElement(LogicalDirection.Forward) as List; 310Block nextBlock = block == lastBlock ? null : block.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as Block; 374ListItem nextListItem = listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as ListItem; 560ListItem nextListItem = listItem.ElementEnd.GetAdjacentElement(LogicalDirection.Forward) as ListItem; 607while (end.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 613end = end.GetNextContextPosition(LogicalDirection.Forward); 636while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd) 643position = position.GetNextContextPosition(LogicalDirection.Forward); 647while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 656position = position.GetNextContextPosition(LogicalDirection.Forward); 764TextPointer adjustedEnd = list.ElementEnd.GetInsertionPosition(LogicalDirection.Backward); 767adjustedEnd = adjustedEnd.GetNextInsertionPosition(LogicalDirection.Forward);
System\Windows\Documents\TextRangeEditTables.cs (35)
69TextPointer lastCellPointer = (TextPointer)range.TextSegments[0].End.GetNextInsertionPosition(LogicalDirection.Backward); 430internal static TextPointer GetNextTableCellRangeInsertionPosition(TextSelection selection, LogicalDirection direction) 451if (direction == LogicalDirection.Backward && movingCell == anchorCell) 456else if (direction == LogicalDirection.Forward && 469if (direction == LogicalDirection.Forward) 530movingPosition = movingCell.ContentEnd.GetInsertionPosition().GetNextInsertionPosition(LogicalDirection.Forward); 540if (direction == LogicalDirection.Forward) 560internal static TextPointer GetNextRowEndMovingPosition(TextSelection selection, LogicalDirection direction) 569return (direction == LogicalDirection.Forward) ? row.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward) : 570row.ContentStart.GetNextInsertionPosition(LogicalDirection.Backward); 589internal static TextPointer GetNextRowStartMovingPosition(TextSelection selection, LogicalDirection direction) 601return (direction == LogicalDirection.Forward) ? row.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward) : 602row.ContentStart.GetNextInsertionPosition(LogicalDirection.Backward); 748bool insertBefore = position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart; 786nextInsertionPosition = nextInsertionPosition.GetNextInsertionPosition(LogicalDirection.Forward); 811while (position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 813position = position.GetNextContextPosition(LogicalDirection.Forward); 815while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd) 817position = position.GetNextContextPosition(LogicalDirection.Backward); 892if (position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is Run) 895insertionPosition.MoveToNextContextPosition(LogicalDirection.Forward); 898else if (position.GetAdjacentElementFromOuterPosition(LogicalDirection.Backward) is Run) 901insertionPosition.MoveToNextContextPosition(LogicalDirection.Backward); 1077TextPointer end = ((TextPointer)textSegment.End).GetNextInsertionPosition(LogicalDirection.Backward); 1085cellEnd.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1087cell = (TableCell)cellEnd.GetAdjacentElement(LogicalDirection.Forward); 1962startPosition = startPosition.GetInsertionPosition(LogicalDirection.Forward); 1965endPosition = endPosition.GetInsertionPosition(LogicalDirection.Backward); 1990TextPointer start = startCell.ContentStart.GetInsertionPosition(LogicalDirection.Forward); 1994TextPointer end = endCell.ContentEnd.GetNextInsertionPosition(LogicalDirection.Forward); 2051anchorPosition = anchorPosition.GetInsertionPosition(LogicalDirection.Forward); 2054movingPosition = movingPosition.GetInsertionPosition(LogicalDirection.Backward); 2092movingPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
System\Windows\Documents\TextRangeSerialization.cs (54)
82range.End.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart; 211while (rangeEnd.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 213rangeEnd = rangeEnd.GetNextContextPosition(LogicalDirection.Backward); 219TextPointerContext runType = textReader.GetPointerContext(LogicalDirection.Forward); 224TextElement nextElement = (TextElement)textReader.GetAdjacentElement(LogicalDirection.Forward); 233textReader.MoveToNextContextPosition(LogicalDirection.Forward); 253textReader.MoveToNextContextPosition(LogicalDirection.Forward); 261textReader.MoveToNextContextPosition(LogicalDirection.Forward); 271if (ignoreWriteHyperlinkEnd && (textReader.GetAdjacentElement(LogicalDirection.Forward) is Hyperlink)) 275textReader.MoveToNextContextPosition(LogicalDirection.Forward); 288textReader.MoveToNextContextPosition(LogicalDirection.Forward); 305textReader.MoveToNextContextPosition(LogicalDirection.Forward); 309int textLength = textReader.GetTextRunLength(LogicalDirection.Forward); 312textLength = TextPointerBase.GetTextWithLimit(textReader, LogicalDirection.Forward, text, 0, textLength, rangeEnd); 319textReader.MoveToNextContextPosition(LogicalDirection.Forward); 323object embeddedObject = textReader.GetAdjacentElement(LogicalDirection.Forward); 324textReader.MoveToNextContextPosition(LogicalDirection.Forward); 331textReader.MoveToNextContextPosition(LogicalDirection.Forward); 552InlineUIContainer inlineUIContainer = textReader.GetAdjacentElement(LogicalDirection.Backward) as InlineUIContainer; 553BlockUIContainer blockUIContainer = textReader.GetAdjacentElement(LogicalDirection.Backward) as BlockUIContainer; 1232TextElement uiContainer = fragment.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 1338fragmentEnd = fragment.ElementEnd.GetPositionAtOffset(0, LogicalDirection.Forward); // need forward orientation to stick with the following content during merge at fragmentStart position 1366fragmentEnd = fragmentEnd.GetInsertionPosition(LogicalDirection.Forward); 1420while (positionBeforeParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1423positionBeforeParagraph = positionBeforeParagraph.GetNextContextPosition(LogicalDirection.Backward); 1425while (positionBeforeParagraph.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && 1429positionBeforeParagraph = positionBeforeParagraph.GetNextContextPosition(LogicalDirection.Backward); 1463if (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd) 1465navigator = navigator.GetNextContextPosition(LogicalDirection.Backward); 1481if (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart) 1483navigator = navigator.GetNextContextPosition(LogicalDirection.Forward); 1518TextPointerContext forwardFromStart = start.GetPointerContext(LogicalDirection.Forward); 1519TextPointerContext backwardFromEnd = end.GetPointerContext(LogicalDirection.Backward); 1522Invariant.Assert(itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1524Invariant.Assert(itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1528TextPointerContext backwardFromStart = start.GetPointerContext(LogicalDirection.Backward); 1529TextPointerContext forwardFromEnd = end.GetPointerContext(LogicalDirection.Forward); 1531Invariant.Assert(!(backwardFromStart == TextPointerContext.ElementEnd) || itemType.IsAssignableFrom(start.GetAdjacentElement(LogicalDirection.Backward).GetType()), 1534Invariant.Assert(!(forwardFromEnd == TextPointerContext.ElementStart) || itemType.IsAssignableFrom(end.GetAdjacentElement(LogicalDirection.Forward).GetType()), 1556((Section)fragment).HasTrailingParagraphBreakOnPaste = range.End.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.None; 1612start = start.GetNextContextPosition(LogicalDirection.Forward); 1616TextPointerContext passedContext = start.GetPointerContext(LogicalDirection.Backward); 1656start = start.GetNextContextPosition(LogicalDirection.Forward); 1663start = start.GetNextContextPosition(LogicalDirection.Forward); 1853Invariant.Assert(textReader.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 1858elementEnd.MoveToNextContextPosition(LogicalDirection.Forward); 1880Invariant.Assert(textReader.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart); 1881Invariant.Assert(typeof(Hyperlink).IsAssignableFrom(textReader.GetElementType(LogicalDirection.Forward))); 1886Hyperlink hyperlink = (Hyperlink)textReader.GetAdjacentElement(LogicalDirection.Forward); 1891hyperlinkEnd.MoveToNextContextPosition(LogicalDirection.Forward); 1906InlineUIContainer inlineUIContainer = hyperlinkNavigation.GetAdjacentElement(LogicalDirection.Forward) as InlineUIContainer; 1913hyperlinkNavigation.MoveToNextContextPosition(LogicalDirection.Forward); 1928hyperlinkStart = range.Start.CreatePointer(LogicalDirection.Forward); 1929while (hyperlinkStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
System\Windows\Documents\TextSchema.cs (5)
163TextElement leftElement = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Backward); 164TextElement rightElement = position.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward); 894TextPointerContext forwardContext = start.GetPointerContext(LogicalDirection.Forward); 897TextElement nextElement = (TextElement)start.GetAdjacentElement(LogicalDirection.Forward); 910start = start.GetNextContextPosition(LogicalDirection.Forward);
System\windows\Documents\TextSegment.cs (2)
76_start = startPosition.GetFrozenPointer(preserveLogicalDirection ? startPosition.LogicalDirection : LogicalDirection.Backward); 77_end = endPosition.GetFrozenPointer(preserveLogicalDirection ? endPosition.LogicalDirection : LogicalDirection.Forward);
System\windows\Documents\TextSelection.cs (64)
303((ITextSelection)this).SetCaretToPosition(((ITextRange)this).End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 454void ITextSelection.SetCaretToPosition(ITextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace) 469ITextPointer reversePosition = caretPosition.CreatePointer(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward); 475TextPointerBase.IsNextToPlainLineBreak(caretPosition, LogicalDirection.Backward) || 476TextSchema.IsBreak(caretPosition.GetElementType(LogicalDirection.Backward)))) 480caretPosition.SetLogicalDirection(LogicalDirection.Forward); 484if (caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text && 485caretPosition.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 507LogicalDirection oppositeDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward; 584bool ITextSelection.ExtendToNextInsertionPosition(LogicalDirection direction) 619if (newMovingPosition == null && direction == LogicalDirection.Forward) 639LogicalDirection contentDirection = (anchorPosition.CompareTo(newMovingPosition) <= 0) ? 640LogicalDirection.Backward : LogicalDirection.Forward; 656private ITextPointer GetNextTextSegmentInsertionPosition(LogicalDirection direction) 843startPosition = anchorWordRange.Start.GetFrozenPointer(LogicalDirection.Forward); 844movingPosition = cursorWordRange.End.GetFrozenPointer(LogicalDirection.Backward); 848startPosition = anchorWordRange.End.GetFrozenPointer(LogicalDirection.Backward); 849movingPosition = cursorWordRange.Start.GetFrozenPointer(LogicalDirection.Forward); 965anchorWordRange.Contains(cursorPosition.GetInsertionPosition(LogicalDirection.Forward)) || 966anchorWordRange.Contains(cursorPosition.GetInsertionPosition(LogicalDirection.Backward))) 978TextPointerBase.IsAtWordBoundary(anchorPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 992TextPointerBase.IsAtWordBoundary(cursorPosition, /*insideWordDirection:*/LogicalDirection.Forward)) 1027bool ITextSelection.ExtendToNextTableRow(LogicalDirection direction) 1055if (direction == LogicalDirection.Forward) 1084movingPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 1184internal void SetCaretToPosition(TextPointer caretPosition, LogicalDirection direction, bool allowStopAtLineEnd, bool allowStopNearSpace) 1192internal bool ExtendToNextInsertionPosition(LogicalDirection direction) 1389this.SetCaretToPosition(cellStart, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1553Invariant.Assert(this.Start.LogicalDirection == LogicalDirection.Backward); 1554Invariant.Assert(this.End.LogicalDirection == LogicalDirection.Forward); 1759return (This.Start.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text && 1760This.End.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text && 1761This.Start.GetNextInsertionPosition(LogicalDirection.Backward) == null && 1762This.End.GetNextInsertionPosition(LogicalDirection.Forward) == null); 1997(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X < cursorMousePoint.X || 1998cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X < objectEdgeRect.X)) 2003(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X > cursorMousePoint.X || 2004cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X > objectEdgeRect.X)) 2012(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X > cursorMousePoint.X || 2013cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X > objectEdgeRect.X)) 2018(cursorPosition.LogicalDirection == LogicalDirection.Forward && objectEdgeRect.X < cursorMousePoint.X || 2019cursorPosition.LogicalDirection == LogicalDirection.Backward && cursorMousePoint.X < objectEdgeRect.X)) 2181if ((caretPosition.LogicalDirection == LogicalDirection.Backward && // 2182caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) || // 2189caretPosition.MoveToNextInsertionPosition(LogicalDirection.Backward); 2190caretPosition.SetLogicalDirection(LogicalDirection.Forward); 2198if (caretPosition.LogicalDirection == LogicalDirection.Backward && // 2199caretPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart && // 2200(caretPosition.GetNextInsertionPosition(LogicalDirection.Backward) == null || // 2201TextPointerBase.IsNextToAnyBreak(caretPosition, LogicalDirection.Backward))) 2204caretPosition.SetLogicalDirection(LogicalDirection.Forward); 2278nextCharacterPosition = focusedTextSelection.Start.CreatePointer(LogicalDirection.Forward); 2283nextCharacterPosition.MoveToNextInsertionPosition(LogicalDirection.Forward); 2284nextCharacterPosition.SetLogicalDirection(LogicalDirection.Backward); 2292nextCharacterPosition = focusedTextSelection.End.CreatePointer(LogicalDirection.Backward); 2297nextCharacterPosition.MoveToNextInsertionPosition(LogicalDirection.Backward); 2298nextCharacterPosition.SetLogicalDirection(LogicalDirection.Forward); 2758private LogicalDirection _movingPositionDirection;
System\windows\Documents\TextSelectionHighlightLayer.cs (6)
57internal override object GetHighlightValue(StaticTextPointer textPosition, LogicalDirection direction) 74internal override bool IsContentHighlighted(StaticTextPointer textPosition, LogicalDirection direction) 92if ((direction == LogicalDirection.Forward && textSegment.Start.CompareTo(textPosition) <= 0 && textPosition.CompareTo(textSegment.End) < 0) || // 93(direction == LogicalDirection.Backward && textSegment.Start.CompareTo(textPosition) < 0 && textPosition.CompareTo(textSegment.End) <= 0)) 103internal override StaticTextPointer GetNextChangePosition(StaticTextPointer textPosition, LogicalDirection direction) 117if (direction == LogicalDirection.Forward)
System\Windows\Documents\TextServicesPropertyRanges.cs (2)
138start = _textstore.CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 139end = _textstore.CreatePointerAtCharOffset(startIndex + length, LogicalDirection.Forward);
System\Windows\Documents\TextStore.cs (73)
378this.TextSelection.SetCaretToPosition(start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 418navigator = CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 419limit = (endIndex >= 0) ? CreatePointerAtCharOffset(endIndex, LogicalDirection.Forward) : null; 426TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Forward); 440TextElement element = (TextElement)((TextPointer)navigator).GetAdjacentElement(LogicalDirection.Forward); 449navigator.MoveToNextContextPosition(LogicalDirection.Forward); 455navigator.MoveToNextContextPosition(LogicalDirection.Forward); 502start = start.GetNextInsertionPosition(LogicalDirection.Forward); 696startNavigator.SetLogicalDirection(LogicalDirection.Backward); 698endNavigator.SetLogicalDirection(LogicalDirection.Forward); 876position = CreatePointerAtCharOffset(index, LogicalDirection.Forward); 992ITextPointer positionCur = position.CreatePointer(LogicalDirection.Backward); 993ITextPointer positionPrev = position.CreatePointer(LogicalDirection.Forward); 994positionPrev.MoveToNextInsertionPosition(LogicalDirection.Backward); 1061startPointer = CreatePointerAtCharOffset(startIndex, LogicalDirection.Forward); 1062startPointer.MoveToInsertionPosition(LogicalDirection.Forward); 1072Rect rectStart = startPointer.GetCharacterRect(LogicalDirection.Forward); 1080endPointer = CreatePointerAtCharOffset(endIndex, LogicalDirection.Backward); 1081endPointer.MoveToInsertionPosition(LogicalDirection.Backward); 1102lineRect = navigator.GetCharacterRect(LogicalDirection.Forward); 1103moved = navigator.MoveToNextInsertionPosition(LogicalDirection.Forward); 1497navigator.MoveToInsertionPosition(LogicalDirection.Forward); 1502if (navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text) 1508navigator.GetTextInRun(LogicalDirection.Forward, nextChars, 0, nextChars.Length); 1514TextSelection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 1913internal ITextPointer CreatePointerAtCharOffset(int charOffset, LogicalDirection direction) 2022this.TextSelection.SetCaretToPosition(range.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 2396_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward); 2397_previousCompositionEnd = (_previousCompositionEndOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionEndOffset, LogicalDirection.Forward); 2415_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward); 2416_previousCompositionEnd = (_previousCompositionEndOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionEndOffset, LogicalDirection.Forward); 2463Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text); 2470runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2479runCount = navigator.GetTextRunLength(LogicalDirection.Forward); 2480navigator.MoveToNextContextPosition(LogicalDirection.Forward); 2522Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement); 2532navigator.MoveToNextContextPosition(LogicalDirection.Forward); 2564Invariant.Assert(navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart || navigator.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd); 2582char ch = (navigator.GetAdjacentElement(LogicalDirection.Forward) is TableCell) ? UnsafeNativeMethods.TS_CHAR_REGION : '\n'; 2913start = CreatePointerAtCharOffset(startIndex, LogicalDirection.Backward); 2914end = CreatePointerAtCharOffset(startIndex + length, LogicalDirection.Forward); 2916while (start.CompareTo(end) < 0 && start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) 2918start.MoveToNextContextPosition(LogicalDirection.Forward); 3041positionNext.MoveToNextInsertionPosition(LogicalDirection.Forward); 3045positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward); 3184Rect lineBounds = start.GetCharacterRect(LogicalDirection.Forward); 3185lineBounds.Union(end.GetCharacterRect(LogicalDirection.Backward)); 3188ITextPointer navigator = start.CreatePointer(LogicalDirection.Forward); 3189while (navigator.MoveToNextContextPosition(LogicalDirection.Forward) == true && navigator.CompareTo(end) < 0) 3191TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Backward); 3195lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward)); 3200lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward)); 3418TextPointer previousPosition = start.GetNextInsertionPosition(LogicalDirection.Backward); 3431if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart) 3433start = start.GetNextInsertionPosition(LogicalDirection.Backward); 3437start = start.GetNextInsertionPosition(LogicalDirection.Forward); 3445start = start.GetNextInsertionPosition(LogicalDirection.Forward); 3465start = CreatePointerAtCharOffset(startCharOffset, LogicalDirection.Forward); 3466end = (startCharOffset == endCharOffset) ? start : CreatePointerAtCharOffset(endCharOffset, LogicalDirection.Backward); 3471TextPointerContext forwardContext = start.GetPointerContext(LogicalDirection.Forward); 3475TextElement element = start.GetAdjacentElement(LogicalDirection.Forward) as TextElement; 3487start.MoveToNextContextPosition(LogicalDirection.Forward); 3498start = start.GetFormatNormalizedPosition(LogicalDirection.Backward); 3503start = start.GetFormatNormalizedPosition(LogicalDirection.Backward); 3504end = end.GetFormatNormalizedPosition(LogicalDirection.Backward); 3646ITextPointer start = this.TextContainer.CreatePointerAtOffset(record.StartOffsetBefore, LogicalDirection.Backward); 3647ITextPointer end = this.TextContainer.CreatePointerAtOffset(record.EndOffsetBefore, LogicalDirection.Forward); 3808start = end.GetFrozenPointer(LogicalDirection.Backward); 3965ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(appSelectionAnchorOffset, LogicalDirection.Forward); 3966ITextPointer moving = this.TextContainer.CreatePointerAtOffset(appSelectionMovingOffset, LogicalDirection.Forward); 3986ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(imeSelectionAnchorOffset, LogicalDirection.Backward); 3987ITextPointer moving = this.TextContainer.CreatePointerAtOffset(imeSelectionMovingOffset, LogicalDirection.Backward);
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (6)
42node = start.GetAdjacentNode(LogicalDirection.Forward); 43haltNode = end.GetAdjacentNode(LogicalDirection.Forward); 76navigator = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 428navigator.MoveToNextContextPosition(LogicalDirection.Backward); 444navigator.MoveToNextContextPosition(LogicalDirection.Forward); 476TextPointer textPointerTable = new TextPointer(navigator.TextContainer.Start, _cpTable, LogicalDirection.Forward);
System\Windows\Documents\TextTreeExtractElementUndoUnit.cs (3)
62start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 63end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount - 2, LogicalDirection.Forward); 73end.MoveToNextContextPosition(LogicalDirection.Backward);
System\Windows\Documents\TextTreeFixupNode.cs (1)
108internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreeInsertElementUndoUnit.cs (3)
55start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 57Invariant.Assert(start.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree."); 59element = start.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward);
System\Windows\Documents\TextTreeInsertUndoUnit.cs (2)
55start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 56end = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount, LogicalDirection.Forward);
System\Windows\Documents\TextTreeNode.cs (4)
368internal abstract TextPointerContext GetPointerContext(LogicalDirection direction); 472return GetEdgeFromOffset(nodeOffset, LogicalDirection.Forward); 475internal ElementEdge GetEdgeFromOffset(int nodeOffset, LogicalDirection bias) 484edge = (bias == LogicalDirection.Forward) ? ElementEdge.AfterEnd : ElementEdge.BeforeStart;
System\Windows\Documents\TextTreeObjectNode.cs (1)
73internal override TextPointerContext GetPointerContext(LogicalDirection direction)
System\Windows\Documents\TextTreePropertyUndoUnit.cs (2)
51position = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward); 53Invariant.Assert(position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart, "TextTree undo unit out of sync with TextTree.");
System\Windows\Documents\TextTreeRootNode.cs (1)
86internal 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)
71internal static void VerifyDirection(LogicalDirection direction, string argumentName) 73if (direction != LogicalDirection.Forward && 74direction != LogicalDirection.Backward) 76throw 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)
304string firstLineText = secondLinePointer.GetTextInRun(LogicalDirection.Backward); 305string secondLineText = secondLinePointer.GetTextInRun(LogicalDirection.Forward); 413lastCharacter = nextLinePointer.GetCharacterRect(LogicalDirection.Backward); 414firstCharacter = currentLinePointer.GetCharacterRect(LogicalDirection.Forward); 421lastCharacter = _textBlock1.ContentEnd.GetCharacterRect(LogicalDirection.Backward); 422firstCharacter = currentLinePointer.GetCharacterRect(LogicalDirection.Forward);