src\Framework\MS\Internal\Documents\TextBoxView.cs (27)
637if (offset > 0 && position.LogicalDirection == LogicalDirection.Backward)
668if (position.LogicalDirection == LogicalDirection.Backward && position.Offset > 0)
710lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward));
749ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[lineIndex].EndOffset, LogicalDirection.Backward);
750if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward))
833else if (position.LogicalDirection == LogicalDirection.Backward)
864if (position.Offset == 0 && direction == LogicalDirection.Backward)
870return position.GetFrozenPointer(LogicalDirection.Backward);
901logicalDirection = LogicalDirection.Backward;
909direction == LogicalDirection.Backward)
919logicalDirection = LogicalDirection.Backward;
924logicalDirection = (nextCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
946int lineIndex = GetLineIndexFromPosition(position, LogicalDirection.Backward);
967logicalDirection = LogicalDirection.Backward;
972logicalDirection = (backspaceCharacterHit.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
1309ITextPointer start = _host.TextContainer.CreatePointerAtOffset(_lineMetrics[0].Offset, LogicalDirection.Backward);
1708if (offset > 0 && direction == LogicalDirection.Backward)
1760logicalDirection = (charIndex.TrailingLength > 0) ? LogicalDirection.Backward : LogicalDirection.Forward;
1937int lastLineIndex = GetLineIndexFromOffset(endOffset, LogicalDirection.Backward);
2055ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward);
2056if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward))
2100ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward);
2102if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward))
2151ITextPointer position = _host.TextContainer.CreatePointerAtOffset(unclippedStartOffset, LogicalDirection.Backward);
2152if (TextPointerBase.IsNextToPlainLineBreak(position, LogicalDirection.Backward))
2179ITextPointer endOfLinePosition = _host.TextContainer.CreatePointerAtOffset(endOffset, LogicalDirection.Backward);
2181if (TextPointerBase.IsNextToPlainLineBreak(endOfLinePosition, LogicalDirection.Backward))
src\Framework\System\Windows\Documents\FixedFindEngine.cs (6)
157end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber)));
163end = new DocumentSequenceTextPointer(childBlock, new FixedTextPointer(false, LogicalDirection.Backward, fixedDoc.FixedContainer.FixedTextBuilder.GetPageEndFlowPosition(translatedPageNumber)));
172end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber));
178end = new FixedTextPointer(false, LogicalDirection.Backward, textBuilder.GetPageEndFlowPosition(pageNumber));
331new FixedTextPointer(false, LogicalDirection.Backward, pageEndFlowPosition));
337firstSearchPageEnd = new FixedTextPointer(false, LogicalDirection.Backward, startAsFTP.FixedTextContainer.FixedTextBuilder.GetPageEndFlowPosition(pageNumber));
src\Framework\System\Windows\Documents\Speller.cs (17)
216ExpandToWordBreakAndContext(error.Start, LogicalDirection.Backward, language, out contentStart, out contextStart);
778wordBreakLeft = SearchForWordBreaks(caretPosition, LogicalDirection.Backward, language, 1, false /* stopOnError */);
794FindPositionInSegmentList(textMap, LogicalDirection.Backward, segments, out leftBreakOffset, out rightBreakOffset);
869ExpandToWordBreakAndContext(start, LogicalDirection.Backward, language, out contentStart, out contextStart);
1200inwardDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward;
1206if (direction == LogicalDirection.Backward)
1241if (direction == LogicalDirection.Backward)
1258if (direction == LogicalDirection.Backward)
1285if (direction == LogicalDirection.Backward)
1373if (direction == LogicalDirection.Backward)
1425searchPosition.MoveByOffset(direction == LogicalDirection.Backward ? -ContextBlockSize : +ContextBlockSize);
1430if (direction == LogicalDirection.Backward && closestErrorPosition.CompareTo(searchPosition) > 0 ||
1441if (direction == LogicalDirection.Backward && closestLanguageTransition.CompareTo(searchPosition) > 0 ||
1448if (direction == LogicalDirection.Backward)
1476(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) > 0))
1486(direction == LogicalDirection.Backward && navigator.CompareTo(haltPosition) < 0))
1790_basePosition = contextStart.GetFrozenPointer(LogicalDirection.Backward);
src\Framework\System\Windows\Documents\TextContainer.cs (11)
538edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward);
650edge = (direction == LogicalDirection.Backward) ? ElementEdge.AfterStart : ElementEdge.BeforeEnd;
661edge = (direction == LogicalDirection.Backward) ? ElementEdge.BeforeStart : ElementEdge.AfterEnd;
672edge = node.GetEdgeFromOffset(nodeOffset, LogicalDirection.Backward);
878originalPosition = this.HasListeners ? new TextPointer(position, LogicalDirection.Backward) : null;
890direction = LogicalDirection.Backward;
903if ((direction == LogicalDirection.Backward && textNode.AfterEndReferenceCount) ||
1612if (!_rootNode.CaretUnitBoundaryCache && position.LogicalDirection == LogicalDirection.Backward)
1655startPosition = new TextPointer(this, _rootNode, ElementEdge.AfterStart, LogicalDirection.Backward);
2808startPosition = new TextPointer(this, elementNode, ElementEdge.BeforeStart, LogicalDirection.Backward);
2813endPosition = new TextPointer(this, elementNode, ElementEdge.AfterEnd, LogicalDirection.Backward);
src\Framework\System\windows\Documents\TextEditorSelection.cs (35)
138ITextPointer lineEnd = position.CreatePointer(LogicalDirection.Backward);
211LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
227LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
244LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
260LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
426ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward);
491This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
496This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
540This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
545if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward))
549This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
876LogicalDirection orientation = TextPointerBase.IsNextToPlainLineBreak(lineRange.End, LogicalDirection.Backward) ? LogicalDirection.Forward : LogicalDirection.Backward;
939This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
970LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
986LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
1002LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Backward : LogicalDirection.Forward;
1018LogicalDirection movementDirection = IsFlowDirectionRightToLeftThenTopToBottom(This) ? LogicalDirection.Forward : LogicalDirection.Backward;
1166newMovingPosition = newMovingPosition.GetFrozenPointer(LogicalDirection.Backward);
1208if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward))
1284ITextPointer previousPosition = lineStartPosition.GetNextInsertionPosition(LogicalDirection.Backward);
1393if (movingPointer.MoveToNextInsertionPosition(LogicalDirection.Backward))
1694TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward))
1712destination = destination.GetFrozenPointer(LogicalDirection.Backward);
2091LogicalDirection contentDirection = direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward;
2145textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
2154textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
2172TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward);
2218wordBoundary.SetLogicalDirection(direction == LogicalDirection.Forward ? LogicalDirection.Backward : LogicalDirection.Forward);
2330movingPosition.LogicalDirection == LogicalDirection.Backward &&
2332TextPointerBase.IsNextToAnyBreak(movingPosition, LogicalDirection.Backward))
2334movingPosition = movingPosition.GetNextInsertionPosition(LogicalDirection.Backward);
2338if (TextPointerBase.IsNextToPlainLineBreak(movingPosition, LogicalDirection.Backward))
2420ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward);
2436ITextPointer cellEnd = position.GetNextInsertionPosition(LogicalDirection.Backward);
src\Framework\System\windows\Documents\TextEditorTyping.cs (22)
645ITextPointer deletePosition = position.GetNextInsertionPosition(LogicalDirection.Backward);
670position = position.GetFrozenPointer(LogicalDirection.Backward);
677position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text)
699This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward);
707else if (backspacePosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.Text)
716This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward);
748This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true);
764LogicalDirection directionOfDelete = position.CompareTo(deletePosition) < 0 ? LogicalDirection.Forward : LogicalDirection.Backward;
799if (directionOfDelete == LogicalDirection.Backward)
836position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
842while (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
849position = position.GetNextContextPosition(LogicalDirection.Backward);
850if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
858position = position.GetNextContextPosition(LogicalDirection.Backward);
869if (position.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart)
883while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
890if (!(navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
998TextPointerBase.MoveToNextWordBoundary(wordBoundary, LogicalDirection.Backward);
1402if (HandleTabInTables(This, LogicalDirection.Backward))
1434This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
1582ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward);
1585This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
src\Framework\System\Windows\Documents\TextPointerBase.cs (36)
92else if (direction == LogicalDirection.Backward && limit.CompareTo(thisPointer) >= 0)
187Type backwardType = backwardPosition.GetElementType(LogicalDirection.Backward);
191TextPointerContext backwardContext = backwardPosition.GetPointerContext(LogicalDirection.Backward);
232TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
257TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
274position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart;
390return IsAtNonMergeableInlineEdge(position, LogicalDirection.Backward);
425if (position.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart &&
556MoveToNextWordBoundary(navigator, direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward);
560if (direction == LogicalDirection.Backward)
569wordStart = RestrictWithinBlock(thisPosition, wordStart, LogicalDirection.Backward);
575wordStart = wordStart.GetFrozenPointer(LogicalDirection.Backward);
580wordStart = wordEnd.GetFrozenPointer(LogicalDirection.Backward);
590Invariant.Assert(!(direction == LogicalDirection.Backward) || position.CompareTo(limit) >= 0, "for backward direction position must be >= than limit");
593while (direction == LogicalDirection.Backward ? position.CompareTo(limit) > 0 : position.CompareTo(limit) < 0)
614return limit.GetInsertionPosition(direction == LogicalDirection.Backward ? LogicalDirection.Forward : LogicalDirection.Backward);
633(direction == LogicalDirection.Backward && IsCharUnicodeNewLine(textBuffer[1]))
720thisPosition.GetPointerContext(LogicalDirection.Backward) != TextPointerContext.ElementStart;
731thisPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementEnd &&
732!typeof(Inline).IsAssignableFrom(thisPosition.GetElementType(LogicalDirection.Backward));
746while (pointer.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
752pointer = pointer.GetNextContextPosition(LogicalDirection.Backward);
784paragraphOrBlockUIContainer.ElementStart.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
988(direction == LogicalDirection.Backward && thisNavigator.CompareTo(initialPosition) < 0))
1018if (direction == LogicalDirection.Backward)
1156oppositeDirection = LogicalDirection.Backward;
1269symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward);
1274if (direction == LogicalDirection.Backward && IsAtNonMergeableInlineStart(thisNavigator))
1276symbolCount += LeaveNonMergeableAncestor(thisNavigator, LogicalDirection.Backward);
1337TextPointerContext backwardContext = position.GetPointerContext(LogicalDirection.Backward);
1372if (position.GetTextInRun(LogicalDirection.Backward, neighborhood, 0, 1) == 1 &&
1431runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount);
1441navigator.MoveToInsertionPosition(LogicalDirection.Backward);
1443while (navigator.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.Text);
src\Framework\System\Windows\Documents\TextStore.cs (26)
271this.TextSelection.SetCaretToPosition(start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
564startNavigator.SetLogicalDirection(LogicalDirection.Backward);
861ITextPointer positionCur = position.CreatePointer(LogicalDirection.Backward);
863positionPrev.MoveToNextInsertionPosition(LogicalDirection.Backward);
940endPointer = CreatePointerAtCharOffset(endIndex, LogicalDirection.Backward);
941endPointer.MoveToInsertionPosition(LogicalDirection.Backward);
1900this.TextSelection.SetCaretToPosition(range.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true);
2261_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward);
2280_previousCompositionStart = (_previousCompositionStartOffset == -1) ? null : textEditor.TextContainer.CreatePointerAtOffset(_previousCompositionStartOffset, LogicalDirection.Backward);
2802start = CreatePointerAtCharOffset(startIndex, LogicalDirection.Backward);
2953positionNext.MoveToNextInsertionPosition(LogicalDirection.Backward);
3094lineBounds.Union(end.GetCharacterRect(LogicalDirection.Backward));
3100TextPointerContext context = navigator.GetPointerContext(LogicalDirection.Backward);
3104lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward));
3109lineBounds.Union(navigator.GetCharacterRect(LogicalDirection.Backward));
3340TextPointer previousPosition = start.GetNextInsertionPosition(LogicalDirection.Backward);
3353if (start.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.ElementStart)
3355start = start.GetNextInsertionPosition(LogicalDirection.Backward);
3388end = (startCharOffset == endCharOffset) ? start : CreatePointerAtCharOffset(endCharOffset, LogicalDirection.Backward);
3420start = start.GetFormatNormalizedPosition(LogicalDirection.Backward);
3425start = start.GetFormatNormalizedPosition(LogicalDirection.Backward);
3426end = end.GetFormatNormalizedPosition(LogicalDirection.Backward);
3548ITextPointer start = this.TextContainer.CreatePointerAtOffset(record.StartOffsetBefore, LogicalDirection.Backward);
3669start = end.GetFrozenPointer(LogicalDirection.Backward);
3829ITextPointer anchor = this.TextContainer.CreatePointerAtOffset(imeSelectionAnchorOffset, LogicalDirection.Backward);
3830ITextPointer moving = this.TextContainer.CreatePointerAtOffset(imeSelectionMovingOffset, LogicalDirection.Backward);