MS\Internal\Documents\TextBoxView.cs (27)
631if (offset > 0 && position.LogicalDirection == LogicalDirection.Backward)
662if (position.LogicalDirection == LogicalDirection.Backward && position.Offset > 0)
704lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward));
743ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].EndOffset, LogicalDirection.Backward);
744if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward))
827else if (position.LogicalDirection == LogicalDirection.Backward)
858if (position.Offset == 0 && direction == LogicalDirection.Backward)
864return position.GetFrozenPointer(LogicalDirection.Backward);
895logicalDirection = LogicalDirection.Backward;
903direction == LogicalDirection.Backward)
913logicalDirection = LogicalDirection.Backward;
918logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
940int lineIndex = GetLineIndexFromPosition(position, LogicalDirection.Backward);
961logicalDirection = LogicalDirection.Backward;
966logicalDirection = (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)
151end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber)));
157end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber)));
166end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber));
172end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber));
324new FixedTextPointer(false, LogicalDirection.Backward, pageEndFlowPosition));
330firstSearchPageEnd = new FixedTextPointer(false, LogicalDirection.Backward, startAsFTP.FixedTextContainer.FixedTextBuilder.GetPageEndFlowPosition(pageNumber));
System\Windows\Documents\Speller.cs (17)
190ExpandToWordBreakAndContext(error.Start, LogicalDirection.Backward, language, out ITextPointer contentStart, out ITextPointer contextStart);
707wordBreakLeft = SearchForWordBreaks(caretPosition, LogicalDirection.Backward, language, 1, false /* stopOnError */);
723FindPositionInSegmentList(textMap, LogicalDirection.Backward, segments, out leftBreakOffset, out rightBreakOffset);
793ExpandToWordBreakAndContext(start, LogicalDirection.Backward, language, out contentStart, out contextStart);
1121inwardDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward;
1127if (direction == LogicalDirection.Backward)
1162if (direction == LogicalDirection.Backward)
1179if (direction == LogicalDirection.Backward)
1206if (direction == LogicalDirection.Backward)
1294if (direction == LogicalDirection.Backward)
1341searchPosition.MoveByOffset(direction == LogicalDirection.Backward ? -ContextBlockSize : +ContextBlockSize);
1346if (direction == LogicalDirection.Backward && closestErrorPosition.CompareTo(searchPosition) > 0 ||
1357if (direction == LogicalDirection.Backward && closestLanguageTransition.CompareTo(searchPosition) > 0 ||
1364if (direction == LogicalDirection.Backward)
1392(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) > 0))
1402(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) < 0))
1658_basePosition = contextStart.GetFrozenPointer(LogicalDirection.Backward);
System\Windows\Documents\TextContainer.cs (11)
518edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward);
630edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd;
641edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd;
652edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward);
858originalPosition = this.HasListeners ? new TextPointer(position, LogicalDirection.Backward) : null;
870direction = LogicalDirection.Backward;
883if ((direction == LogicalDirection.Backward && textNode.AfterEndReferenceCount) ||
1592if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward)
1635startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward);
2788startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward);
2793endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
System\windows\Documents\TextEditorSelection.cs (35)
115ITextPointer lineEnd = position.CreatePointer(LogicalDirection.Backward);
188LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
204LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
221LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
237LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
403ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward);
468This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
473This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
517This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
522if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward))
526This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
852LogicalDirection orientation = TextPointerBase.IsNextToPlainLineBreak(lineRange.End, LogicalDirection.Backward) ? LogicalDirection.Forward : LogicalDirection.Backward;
915This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
946LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
962LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
978LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
994LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
1142newMovingPosition = newMovingPosition.GetFrozenPointer(LogicalDirection.Backward);
1184if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward))
1260ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward);
1369if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward))
1670TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward))
1688destination = destination.GetFrozenPointer(LogicalDirection.Backward);
2067LogicalDirection contentDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward;
2121textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
2130textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
2148TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward);
2194wordBoundary.SetLogicalDirection(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward);
2306movingPosition.LogicalDirection == LogicalDirection.Backward &&
2308TextPointerBase.IsNextToAnyBreak(movingPosition, LogicalDirection.Backward))
2310movingPosition = movingPosition.GetNextInsertionPosition(LogicalDirection.Backward);
2314if (TextPointerBase.IsNextToPlainLineBreak(movingPosition, LogicalDirection.Backward))
2396ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward);
2412ITextPointer cellEnd = position.GetNextInsertionPosition(LogicalDirection.Backward);
System\windows\Documents\TextEditorTyping.cs (22)
620ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Backward);
645position = position.GetFrozenPointer(LogicalDirection.Backward);
652position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text)
674This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward);
682else if (backspacePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text)
691This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward);
723This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true);
739LogicalDirection directionOfDelete = position.CompareTo(deletePosition) < 0 ? LogicalDirection.Forward : LogicalDirection.Backward;
773if (directionOfDelete == LogicalDirection.Backward)
810position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
816while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
823position = position.GetNextContextPosition(LogicalDirection.Backward);
824if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
832position = position.GetNextContextPosition(LogicalDirection.Backward);
843if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart)
857while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
864if (!(navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
972TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward);
1376if (HandleTabInTables(This, LogicalDirection.Backward))
1408This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
1556ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward);
1559This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
System\Windows\Documents\TextPointerBase.cs (36)
88else if (direction == LogicalDirection.Backward && limit.CompareTo(thisPointer) >= 0)
183Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward);
187TextPointerContext backwardContext = backwardPosition.GetPointerContext(LogicalDirection.Backward);
228TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
253TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
270position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart;
386return IsAtNonMergeableInlineEdge(position, LogicalDirection.Backward);
421if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
552MoveToNextWordBoundary(navigator, direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward);
556if (direction == LogicalDirection.Backward)
565wordStart = RestrictWithinBlock(thisPosition, wordStart, LogicalDirection.Backward);
571wordStart = wordStart.GetFrozenPointer(LogicalDirection.Backward);
576wordStart = wordEnd.GetFrozenPointer(LogicalDirection.Backward);
586Invariant.Assert(!(direction == LogicalDirection.Backward) || position.CompareTo(limit) >= 0, "for backward direction position must be >= than limit");
589while (direction == LogicalDirection.Backward ? position.CompareTo(limit) > 0 : position.CompareTo(limit) < 0)
610return limit.GetInsertionPosition(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward);
629(direction == LogicalDirection.Backward && IsCharUnicodeNewLine(textBuffer[1]))
713thisPosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart;
724thisPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd &&
725!typeof(Inline).IsAssignableFrom(thisPosition.GetElementType(LogicalDirection.Backward));
739while (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
745pointer = pointer.GetNextContextPosition(LogicalDirection.Backward);
777paragraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
981(direction == LogicalDirection.Backward && thisNavigator.CompareTo(initialPosition) < 0))
1011if (direction == LogicalDirection.Backward)
1149oppositeDirection = LogicalDirection.Backward;
1262symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward);
1267if (direction == LogicalDirection.Backward && IsAtNonMergeableInlineStart(thisNavigator))
1269symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward);
1330TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
1365if (position.GetTextInRun(LogicalDirection.Backward, neighborhood, 0, 1) == 1 &&
1424runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount);
1434navigator.MoveToInsertionPosition(LogicalDirection.Backward);
1436while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text);
System\Windows\Documents\TextStore.cs (26)
367this.TextSelection.SetCaretToPosition(start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
685startNavigator.SetLogicalDirection(LogicalDirection.Backward);
981ITextPointer positionCur = position.CreatePointer(LogicalDirection.Backward);
983positionPrev.MoveToNextInsertionPosition(LogicalDirection.Backward);
1069endPointer = CreatePointerAtCharOffset(endIndex, LogicalDirection.Backward);
1070endPointer.MoveToInsertionPosition(LogicalDirection.Backward);
2011this.TextSelection.SetCaretToPosition(range.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
2385_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward);
2404_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward);
2904start = CreatePointerAtCharOffset(startIndex, LogicalDirection.Backward);
3036positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward);
3176lineBounds.Union(end.GetCharacterRect(LogicalDirection.Backward));
3182TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Backward);
3186lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward));
3191lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward));
3409TextPointer previousPosition = start.GetNextInsertionPosition(LogicalDirection.Backward);
3422if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
3424start = start.GetNextInsertionPosition(LogicalDirection.Backward);
3457end = (startCharOffset == endCharOffset) ? start : CreatePointerAtCharOffset(endCharOffset, LogicalDirection.Backward);
3489start = start.GetFormatNormalizedPosition(LogicalDirection.Backward);
3494start = start.GetFormatNormalizedPosition(LogicalDirection.Backward);
3495end = end.GetFormatNormalizedPosition(LogicalDirection.Backward);
3637ITextPointer start = this.TextContainer.CreatePointerAtOffset(record.StartOffsetBefore, LogicalDirection.Backward);
3799start = end.GetFrozenPointer(LogicalDirection.Backward);
3977ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(imeSelectionAnchorOffset, LogicalDirection.Backward);
3978ITextPointer moving = this.TextContainer.CreatePointerAtOffset(imeSelectionMovingOffset, LogicalDirection.Backward);