MS\Internal\Documents\TextBoxView.cs (27)
633if (offset > 0 && position.LogicalDirection == LogicalDirection.Backward)
664if (position.LogicalDirection == LogicalDirection.Backward && position.Offset > 0)
706lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward));
745ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].EndOffset, LogicalDirection.Backward);
746if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward))
829else if (position.LogicalDirection == LogicalDirection.Backward)
860if (position.Offset == 0 && direction == LogicalDirection.Backward)
866return position.GetFrozenPointer(LogicalDirection.Backward);
897logicalDirection = LogicalDirection.Backward;
905direction == LogicalDirection.Backward)
915logicalDirection = LogicalDirection.Backward;
920logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
942int lineIndex = GetLineIndexFromPosition(position, LogicalDirection.Backward);
963logicalDirection = LogicalDirection.Backward;
968logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
1307ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[0].Offset, LogicalDirection.Backward);
1710if (offset > 0 && direction == LogicalDirection.Backward)
1762logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : 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))
System\Windows\Documents\FixedFindEngine.cs (6)
153end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber)));
159end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber)));
168end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber));
174end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber));
326new FixedTextPointer(false, LogicalDirection.Backward, pageEndFlowPosition));
332firstSearchPageEnd = new FixedTextPointer(false, LogicalDirection.Backward, startAsFTP.FixedTextContainer.FixedTextBuilder.GetPageEndFlowPosition(pageNumber));
System\Windows\Documents\Speller.cs (17)
194ExpandToWordBreakAndContext(error.Start, LogicalDirection.Backward, language, out ITextPointer contentStart, out ITextPointer contextStart);
711wordBreakLeft = SearchForWordBreaks(caretPosition, LogicalDirection.Backward, language, 1, false /* stopOnError */);
727FindPositionInSegmentList(textMap, LogicalDirection.Backward, segments, out leftBreakOffset, out rightBreakOffset);
797ExpandToWordBreakAndContext(start, LogicalDirection.Backward, language, out contentStart, out contextStart);
1125inwardDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward;
1131if (direction == LogicalDirection.Backward)
1166if (direction == LogicalDirection.Backward)
1183if (direction == LogicalDirection.Backward)
1210if (direction == LogicalDirection.Backward)
1298if (direction == LogicalDirection.Backward)
1345searchPosition.MoveByOffset(direction == LogicalDirection.Backward ? -ContextBlockSize : +ContextBlockSize);
1350if (direction == LogicalDirection.Backward && closestErrorPosition.CompareTo(searchPosition) > 0 ||
1361if (direction == LogicalDirection.Backward && closestLanguageTransition.CompareTo(searchPosition) > 0 ||
1368if (direction == LogicalDirection.Backward)
1396(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) > 0))
1406(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) < 0))
1662_basePosition = contextStart.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\TextContainer.cs (11)
523edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward);
635edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd;
646edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd;
657edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward);
863originalPosition = this.HasListeners ? new TextPointer(position, LogicalDirection.Backward) : null;
875direction = LogicalDirection.Backward;
888if ((direction == LogicalDirection.Backward && textNode.AfterEndReferenceCount) ||
1597if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward)
1640startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward);
2793startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward);
2798endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
System\windows\Documents\TextEditorSelection.cs (35)
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;
418ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward);
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);
867LogicalDirection orientation = TextPointerBase.IsNextToPlainLineBreak(lineRange.End, LogicalDirection.Backward) ? LogicalDirection.Forward : LogicalDirection.Backward;
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;
1157newMovingPosition = newMovingPosition.GetFrozenPointer(LogicalDirection.Backward);
1199if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward))
1275ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward);
1384if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward))
1685TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward))
1703destination = destination.GetFrozenPointer(LogicalDirection.Backward);
2082LogicalDirection contentDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward;
2136textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
2145textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
2163TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward);
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))
2411ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward);
2427ITextPointer cellEnd = position.GetNextInsertionPosition(LogicalDirection.Backward);
System\windows\Documents\TextEditorTyping.cs (22)
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;
782if (directionOfDelete == LogicalDirection.Backward)
819position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
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)
866while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
873if (!(navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
981TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward);
1385if (HandleTabInTables(This, LogicalDirection.Backward))
1417This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
1565ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward);
1568This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
System\Windows\Documents\TextPointerBase.cs (36)
90else if (direction == LogicalDirection.Backward && limit.CompareTo(thisPointer) >= 0)
185Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward);
189TextPointerContext backwardContext = backwardPosition.GetPointerContext(LogicalDirection.Backward);
230TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
255TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
272position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart;
388return IsAtNonMergeableInlineEdge(position, LogicalDirection.Backward);
423if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
554MoveToNextWordBoundary(navigator, direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward);
558if (direction == LogicalDirection.Backward)
567wordStart = RestrictWithinBlock(thisPosition, wordStart, LogicalDirection.Backward);
573wordStart = wordStart.GetFrozenPointer(LogicalDirection.Backward);
578wordStart = wordEnd.GetFrozenPointer(LogicalDirection.Backward);
588Invariant.Assert(!(direction == LogicalDirection.Backward) || position.CompareTo(limit) >= 0, "for backward direction position must be >= than limit");
591while (direction == LogicalDirection.Backward ? position.CompareTo(limit) > 0 : position.CompareTo(limit) < 0)
612return limit.GetInsertionPosition(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward);
631(direction == LogicalDirection.Backward && IsCharUnicodeNewLine(textBuffer[1]))
715thisPosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart;
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)
983(direction == LogicalDirection.Backward && thisNavigator.CompareTo(initialPosition) < 0))
1013if (direction == LogicalDirection.Backward)
1151oppositeDirection = LogicalDirection.Backward;
1264symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward);
1269if (direction == LogicalDirection.Backward && IsAtNonMergeableInlineStart(thisNavigator))
1271symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward);
1332TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
1367if (position.GetTextInRun(LogicalDirection.Backward, neighborhood, 0, 1) == 1 &&
1426runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount);
1436navigator.MoveToInsertionPosition(LogicalDirection.Backward);
1438while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text);
System\Windows\Documents\TextStore.cs (26)
378this.TextSelection.SetCaretToPosition(start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
696startNavigator.SetLogicalDirection(LogicalDirection.Backward);
992ITextPointer positionCur = position.CreatePointer(LogicalDirection.Backward);
994positionPrev.MoveToNextInsertionPosition(LogicalDirection.Backward);
1080endPointer = CreatePointerAtCharOffset(endIndex, LogicalDirection.Backward);
1081endPointer.MoveToInsertionPosition(LogicalDirection.Backward);
2022this.TextSelection.SetCaretToPosition(range.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
2396_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward);
2415_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward);
2913start = CreatePointerAtCharOffset(startIndex, LogicalDirection.Backward);
3045positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward);
3185lineBounds.Union(end.GetCharacterRect(LogicalDirection.Backward));
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);
3466end = (startCharOffset == endCharOffset) ? start : CreatePointerAtCharOffset(endCharOffset, LogicalDirection.Backward);
3498start = start.GetFormatNormalizedPosition(LogicalDirection.Backward);
3503start = start.GetFormatNormalizedPosition(LogicalDirection.Backward);
3504end = end.GetFormatNormalizedPosition(LogicalDirection.Backward);
3646ITextPointer start = this.TextContainer.CreatePointerAtOffset(record.StartOffsetBefore, LogicalDirection.Backward);
3808start = end.GetFrozenPointer(LogicalDirection.Backward);
3986ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(imeSelectionAnchorOffset, LogicalDirection.Backward);
3987ITextPointer moving = this.TextContainer.CreatePointerAtOffset(imeSelectionMovingOffset, LogicalDirection.Backward);