388 references to Selection
PresentationFramework (388)
MS\Internal\Documents\DocumentGrid.cs (5)
291if (TextEditor != null && TextEditor.Selection != null) 294ITextPointer tp = TextEditor.Selection.Start; 1274ITextRange textRange = TextEditor.Selection; 2531ITextPointer tp = TextEditor.Selection.Start; 2550return (TextEditor != null && TextEditor.Selection != null);
MS\Internal\Documents\DocumentViewerHelper.cs (1)
100textSelection = textEditor.Selection;
System\Windows\Controls\DocumentViewer.cs (1)
1361return TextEditor.Selection;
System\Windows\Controls\PasswordBox.cs (2)
1164_textEditor?.Selection.DetachFromVisualTree(); 1239return _textEditor.Selection;
System\Windows\Controls\Primitives\TextBoxBase.cs (8)
386this.TextEditor.Selection.BeginChange(); 394if (this.TextEditor.Selection.ChangeBlockLevel == 0) 399this.TextEditor.Selection.EndChange(); 408return this.TextEditor.Selection.DeclareChangeBlock(); 1424Invariant.Assert(_textEditor.TextContainer.TextSelection == _textEditor.Selection); 1439_textEditor.Selection.Changed += new EventHandler(OnSelectionChangedInternal); 1715return (TextSelection)_textEditor.Selection; 1790_textEditor?.Selection.DetachFromVisualTree();
System\windows\Documents\CaretElement.cs (5)
188((TextSelection)_textEditor.Selection).UpdateCaretState(CaretScrollMethod.None); 439if (!_textEditor.Selection.MovingPosition.HasValidLayout && _textEditor.TextView != null && _textEditor.TextView.IsValid) 455if (!_textEditor.Selection.IsEmpty) 459List<TextSegment> textSegments = _textEditor.Selection.TextSegments; 464Geometry geometry = _textEditor.Selection.TextView.GetTightBoundingGeometryFromTextPositions(segment.Start, segment.End);
System\Windows\Documents\ImmComposition.cs (14)
610startNavigator = _editor.Selection.Start.CreatePointer(); 619endNavigator = _editor.Selection.End.CreatePointer(); 628caretNavigator = _editor.Selection.End.CreatePointer(); 729if (!_editor.Selection.End.HasValidLayout) 753rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 967composition.SetCompositionPositions(_editor.Selection.Start, _editor.Selection.End, compositionString); 1081_editor.Selection.BeginChange(); 1128_editor.Selection.Select(caretPosition, caretPosition); 1136_editor.Selection.EndChange(); 1325range = _editor.Selection; 1516ITextRange range = _editor.Selection; 1530_editor.Selection.Select(start, end); 1764_compositionUndoUnit = new TextParentUndoUnit(_editor.Selection);
System\Windows\Documents\Speller.cs (5)
73_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 487_textEditor.Selection.Changed += new EventHandler(OnCaretMoved); 598_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 675if (!_textEditor.Selection.IsEmpty) 695caretPosition = _textEditor.Selection.Start;
System\windows\Documents\TextEditor.cs (8)
301return textEditor?.Selection; 440SetText(this.Selection, text, cultureInfo); 443((TextSelection)this.Selection).ApplySpringloadFormatting(); 554bool forceLayoutUpdate = this.Selection.CoversEntireContent; 602this.Selection.ValidateLayout(); 615bool forceLayoutUpdate = this.Selection.CoversEntireContent; 655this.Selection.ValidateLayout(); 1508this.Selection.ExtendSelectionByMouse(cursorPosition, _forceWordSelection, _forceParagraphSelection);
System\windows\Documents\TextEditorCharacters.cs (26)
68if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 80TextSelection selection = (TextSelection)This.Selection; 121if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection.Start is TextPointer)) 128using (This.Selection.DeclareChangeBlock()) 131TextPointer startResetFormatPosition = (TextPointer)This.Selection.Start; 132TextPointer endResetFormatPosition = (TextPointer)This.Selection.End; 134if (This.Selection.IsEmpty) 136TextSegment autoWordRange = TextRangeBase.GetAutoWord(This.Selection); 140((TextSelection)This.Selection).ClearSpringloadFormatting(); 166if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 173object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontWeightProperty); 186if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 193object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontStyleProperty); 199This.Selection.RefreshCaret(); 209if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 216object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(Inline.TextDecorationsProperty); 238if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 245FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 257if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 264FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 285if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 292if (This.Selection.IsEmpty) 295double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty); 327if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 334if (This.Selection.IsEmpty) 337double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty);
System\windows\Documents\TextEditorContextMenu.cs (8)
64if ((e.CursorLeft != KeyboardInvokedSentinel && !This.Selection.Contains(renderScopeMouseDownPoint)) || 65(e.CursorLeft == KeyboardInvokedSentinel && This.Selection.IsEmpty)) 70else if ((This.Selection.IsEmpty || e.TargetElement is TextElement) && 80TextPointer start = GetContentPosition(This.Selection.Start) as TextPointer; 115using (This.Selection.DeclareChangeBlock()) // NB: This raises a PUBLIC EVENT. 118if (!This.Selection.Contains(renderScopeMouseDownPoint)) 187position = This.Selection.Start; 248This.Selection.UpdateCaretAndHighlight();
System\windows\Documents\TextEditorCopyPaste.cs (39)
73string textString = This.Selection.Text; 101string xamlTextWithImages = WpfPayload.SaveRange(This.Selection, ref wpfContainerMemory, /*useFlowDocumentAsRoot:*/false); 124Image image = This.Selection.GetUIElementSelected() as Image; 135TextRangeSerialization.WriteXaml(xmlWriter, This.Selection, /*useFlowDocumentAsRoot:*/false, /*wpfPayload:*/null); 276if (This.Selection != null && !This.Selection.IsEmpty) 299using (This.Selection.DeclareChangeBlock()) 303This.Selection.Text = String.Empty; 306if (This.Selection is TextSelection) 308((TextSelection)This.Selection).ClearSpringloadFormatting(); 324if (This.Selection != null && !This.Selection.IsEmpty) 355if (This.Selection.IsTableCellRange) 383bool forceLayoutUpdate = This.Selection.CoversEntireContent; 387using (This.Selection.DeclareChangeBlock()) 397This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 400if (This.Selection is TextSelection) 402((TextSelection)This.Selection).ClearSpringloadFormatting(); 412This.Selection.ValidateLayout(); 496args.CanExecute = !This.Selection.IsEmpty; 541args.CanExecute = !This.Selection.IsEmpty; 678if (This.AcceptsRichContent && This.Selection is TextSelection) 699if (This.AcceptsRichContent && This.Selection is TextSelection) 713((TextSelection)This.Selection).InsertEmbeddedUIElement((FrameworkElement)element); 741if (This.AcceptsRichContent && This.Selection is TextSelection) 876This.Selection.BeginChange(); 879((TextRange)This.Selection).SetXmlVirtual(sectionOrSpan); 882TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.Start); 883TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.End); 886TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.Start); 887TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.End); 893This.Selection.EndChange(); 937pastedText = This._FilterText(pastedText, This.Selection); 941if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 944This.Selection.Text = String.Empty; 947TextPointer start = TextRangeEditTables.EnsureInsertionPosition((TextPointer)This.Selection.Start); 989This.Selection.Select(start, end); 994This.Selection.Text = pastedText;
System\windows\Documents\TextEditorDragDrop.cs (4)
91ITextSelection selection = _textEditor.Selection; 129_textEditor.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 152ITextSelection selection = _textEditor.Selection; 507ITextSelection selection = _textEditor.Selection;
System\windows\Documents\TextEditorLists.cs (6)
39TextSelection thisSelection = (TextSelection)This.Selection; 66if (This != null && This._IsEnabled && !This.IsReadOnly && !This.Selection.IsTableCellRange) 109if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 116if (!TextRangeEditLists.IsListOperationApplicable((TextSelection)This.Selection)) 121using (This.Selection.DeclareChangeBlock()) 123TextSelection thisSelection = (TextSelection)This.Selection;
System\windows\Documents\TextEditorMouse.cs (21)
80if (This.Selection is TextSelection) 82((TextSelection)This.Selection).ClearSpringloadFormatting(); 97This.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 100else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 105This.Selection.SelectWord(cursorPosition); 114This.Selection.SelectParagraph(cursorPosition); 248This.Selection.BeginChange(); 259This.Selection.EndChange(); 346using (This.Selection.DeclareChangeBlock()) 354using (This.Selection.DeclareChangeBlock()) 452Invariant.Assert(This.Selection != null); 480Invariant.Assert(This.Selection != null); 486Invariant.Assert(This.Selection != null); 497Invariant.Assert(This.Selection != null); 554using (This.Selection.DeclareChangeBlock()) 569This.Selection.ExtendSelectionByMouse(snappedCursorPosition, This._forceWordSelection, This._forceParagraphSelection); 614ITextSelection selection = This.Selection; 683if (This.Selection != null && !This.UiScope.IsMouseCaptured) 685if (This.Selection.IsEmpty) 694else if (This.UiScope.IsFocused && This.Selection.Contains(mouseMovePoint)) 758CaretElement caretElement = textEditor.Selection.CaretElement;
System\windows\Documents\TextEditorSelection.cs (117)
154using (This.Selection.DeclareChangeBlock(true /* disableScroll */)) 156This.Selection.Select(This.TextContainer.Start, This.TextContainer.End); 252if (!This.Selection.End.ValidateLayout()) 257using (This.Selection.DeclareChangeBlock()) 259if (!This.Selection.IsEmpty) 269This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 272Invariant.Assert(This.Selection.IsEmpty); 289ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, +1, out newSuggestedX, out linesMoved); 298This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 313This.Selection.SetCaretToPosition(nextPosition ?? lineEndPosition, 344if (!This.Selection.Start.ValidateLayout()) 349using (This.Selection.DeclareChangeBlock()) 351if (!This.Selection.IsEmpty) 358This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 361Invariant.Assert(This.Selection.IsEmpty); 378ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, -1, out newSuggestedX, out linesMoved); 388This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 403This.Selection.SetCaretToPosition(previousPosition ?? lineStartPosition, 433using (This.Selection.DeclareChangeBlock()) 445if (!This.Selection.IsEmpty) 455This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 458ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 467This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 472This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 488using (This.Selection.DeclareChangeBlock()) 500if (!This.Selection.IsEmpty) 507This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 509ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 513if (This.Selection.Start.CompareTo(paragraphRange.Start) > 0) 516This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 525This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 543if (!This.Selection.End.ValidateLayout()) 548using (This.Selection.DeclareChangeBlock()) 550if (!This.Selection.IsEmpty) 560This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 602This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 640This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 663if (!This.Selection.Start.ValidateLayout()) 668using (This.Selection.DeclareChangeBlock()) 670if (!This.Selection.IsEmpty) 677This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 716This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 754This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/ 796using (This.Selection.DeclareChangeBlock()) 805This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 847using (This.Selection.DeclareChangeBlock()) 857This.Selection.SetCaretToPosition(caretPosition, orientation, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 883using (This.Selection.DeclareChangeBlock()) 885This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 911using (This.Selection.DeclareChangeBlock()) 914This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1009using (This.Selection.DeclareChangeBlock()) 1011if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1181using (This.Selection.DeclareChangeBlock()) 1183if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1304using (This.Selection.DeclareChangeBlock()) 1315ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1345using (This.Selection.DeclareChangeBlock()) 1356ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1398using (This.Selection.DeclareChangeBlock()) 1494using (This.Selection.DeclareChangeBlock()) 1599using (This.Selection.DeclareChangeBlock()) 1645if (lineRange.End.CompareTo(This.Selection.End) < 0) 1650using (This.Selection.DeclareChangeBlock()) 1659if (This.Selection.AnchorPosition.ValidateLayout()) 1661TextSegment anchorLineRange = TextEditorSelection.GetNormalizedLineRange(This.TextView, This.Selection.AnchorPosition); 1662if (!lineRange.IsNull && anchorLineRange.Start.CompareTo(This.Selection.AnchorPosition) == 0) 1669TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1716using (This.Selection.DeclareChangeBlock()) 1744using (This.Selection.DeclareChangeBlock()) 1778using (This.Selection.DeclareChangeBlock()) 1784This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1808using (This.Selection.DeclareChangeBlock()) 1814This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1840using (This.Selection.DeclareChangeBlock()) 1903using (This.Selection.DeclareChangeBlock()) 2007if (This.Selection is TextSelection) 2009((TextSelection)This.Selection).ClearSpringloadFormatting(); 2020ITextPointer position = textEditor.Selection.MovingPosition.CreatePointer(); 2043using (textEditor.Selection.DeclareChangeBlock()) 2048textEditor.Selection.ExtendToNextInsertionPosition(direction); 2051BringIntoView(textEditor.Selection.MovingPosition, textEditor); 2056ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2058if (textEditor.Selection.IsEmpty) 2076textEditor.Selection.SetCaretToPosition(movingEnd, contentDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2081textEditor.Selection.OnCaretNavigation(); 2103using (textEditor.Selection.DeclareChangeBlock()) 2117if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2120textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2126ITextPointer wordBoundary = textEditor.Selection.End.CreatePointer(); 2129textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2137if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2140textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2146ITextPointer wordBoundary = textEditor.Selection.Start.CreatePointer(); 2149textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2156textEditor.Selection.OnCaretNavigation(); 2178using (textEditor.Selection.DeclareChangeBlock()) 2190ITextPointer wordBoundary = textEditor.Selection.MovingPosition.CreatePointer(); 2199textEditor.Selection.OnCaretNavigation(); 2239if (This.Selection.MovingPosition.CompareTo(innerMovingPosition) > 0) 2302ITextPointer movingPosition = This.Selection.MovingPosition; 2306This.Selection.Start.CompareTo(movingPosition) < 0 && 2332return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2344ITextPointer end = This.Selection.End; 2345if (end.CompareTo(This.Selection.MovingPosition) == 0) 2371textEditor.Selection.ExtendToPosition(position); 2393if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.Start)) 2395ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2398This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
System\windows\Documents\TextEditorSpelling.cs (15)
48if (IsSelectionIgnoringErrors(This.Selection)) 58LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 61ITextPointer position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 67position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 79if (This.Selection.IsEmpty) 82position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 87position = GetNextNonWhiteSpacePosition(This.Selection.Start, This.Selection.End); 91position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 133using (This.Selection.DeclareChangeBlock()) 151This.Selection.Select(spellingError.Start, spellingError.End); 157((TextSelection)This.Selection).SpringloadCurrentFormatting(); 165caretPosition = This.Selection.End; 169This.Selection.Select(caretPosition, caretPosition);
System\windows\Documents\TextEditorTables.cs (8)
55if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 68((TextSelection)This.Selection).InsertTable(/*rowCount:*/4, /*columnCount:*/4); 72((TextSelection)This.Selection).InsertRows(+1); 76((TextSelection)This.Selection).InsertColumns(+1); 80((TextSelection)This.Selection).DeleteRows(); 84((TextSelection)This.Selection).DeleteColumns(); 88((TextSelection)This.Selection).MergeCells(); 92((TextSelection)This.Selection).SplitCell(1000, 1000); // Split all ways to possible maximum
System\windows\Documents\TextEditorTyping.cs (89)
271This.SetText(This.Selection, String.Empty, InputLanguageManager.Current.CurrentInputLanguage); 523((TextSelection)This.Selection).ClearSpringloadFormatting(); 528using (This.Selection.DeclareChangeBlock()) 530ITextPointer position = This.Selection.End; 531if (This.Selection.IsEmpty) 556This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 560This.Selection.Text = String.Empty; 578using (This.Selection.DeclareChangeBlock()) 580ITextPointer position = This.Selection.Start; 590if (This.Selection.IsEmpty) 599TextRangeEditLists.ConvertListItemsToParagraphs((TextRange)This.Selection); 602(IsAtListItemChildStart(position, false /* emptyChildOnly */) || IsAtIndentedParagraphOrBlockUIContainerStart(This.Selection.Start))) 615((TextSelection)This.Selection).ClearSpringloadFormatting(); 622((TextSelection)This.Selection).ClearSpringloadFormatting(); 664This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 674This.Selection.Select(This.Selection.End, backspacePosition); 681This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 690((TextSelection)This.Selection).ClearSpringloadFormatting(); 691((TextSelection)This.Selection).SpringloadCurrentFormatting(); 705This.Selection.Text = String.Empty; 706position = This.Selection.Start; 713This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 761This.Selection.SetCaretToPosition(deletePosition, directionOfDelete, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 766((TextSelection)This.Selection).ClearSpringloadFormatting(); 888if (This.Selection.IsTableCellRange) 895ITextPointer wordBoundary = This.Selection.End.CreatePointer(); 901if (This.Selection.IsEmpty) 906if (TextRangeEditTables.IsTableStructureCrossed(This.Selection.Start, wordBoundary)) 911ITextRange textRange = new TextRange(This.Selection.Start, wordBoundary); 921using (This.Selection.DeclareChangeBlock()) 926((TextSelection)This.Selection).ClearSpringloadFormatting(); 929This.Selection.Select(textRange.Start, textRange.End); 932This.Selection.Text = String.Empty; 946if (This.Selection.IsTableCellRange) 954ITextPointer wordBoundary = This.Selection.Start.CreatePointer(); 960if (This.Selection.IsEmpty) 966if (TextRangeEditTables.IsTableStructureCrossed(wordBoundary, This.Selection.Start)) 973ITextRange textRange = new TextRange(wordBoundary, This.Selection.End); 983using (This.Selection.DeclareChangeBlock()) 988((TextSelection)This.Selection).ClearSpringloadFormatting(); 989This.Selection.Select(textRange.Start, textRange.End); 990((TextSelection)This.Selection).SpringloadCurrentFormatting(); 994This.Selection.Select(textRange.Start, textRange.End); 998This.Selection.Text = String.Empty; 1022if (This.Selection.IsTableCellRange || !This.AcceptsReturn) 1041if (This.Selection.IsTableCellRange || !This.AcceptsReturn || !This.UiScope.IsKeyboardFocused) 1049using (This.Selection.DeclareChangeBlock()) 1056if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 1071This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1085((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1087if (!This.Selection.IsEmpty) 1090This.Selection.Text = String.Empty; 1100TextPointer newEnd = ((TextSelection)This.Selection).End; 1121This.Selection.Select(newEnd, newEnd); 1134string filteredText = This._FilterText(Environment.NewLine, This.Selection); 1138This.Selection.Text = Environment.NewLine; 1153Invariant.Assert(This.Selection.Start is TextPointer); 1154TextPointer position = (TextPointer)This.Selection.Start; 1161TextRange range = ((TextSelection)This.Selection).InsertRows(+1); 1162This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1164else if (This.Selection.IsEmpty && 1185This.Selection.Select(newEnd, newEnd); 1208using (This.Selection.DeclareChangeBlock()) 1212if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1215((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.LeftToRight, /*applyToParagraphs*/true); 1228if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1231((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.RightToLeft, /*applyToParagraphs*/true); 1240((TextSelection)This.Selection).UpdateCaretState(CaretScrollMethod.Simple); 1337if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1369if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1391if (This.Selection.IsTableCellRange) 1395This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1399if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.End)) 1403TableRow row = ((TextPointer)This.Selection.End).Parent as TableRow; 1425This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1431TextElement parent = ((TextPointer)This.Selection.Start).Parent as TextElement; 1477This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1524string filteredText = This._FilterText(textData, This.Selection); 1536using (This.Selection.DeclareChangeBlock()) 1538This.Selection.ApplyTypingHeuristics(This.AllowOvertype && This._OvertypeMode && filteredText != "\t"); 1543ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1546This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1789This._typingUndoUnit = new TextParentUndoUnit(This.Selection);
System\windows\Documents\TextSelection.cs (2)
755RefreshCaret(_textEditor, _textEditor.Selection); 1626focusedTextSelection = textEditor.Selection;
System\Windows\Documents\TextStore.cs (4)
2342textEditor.Selection.BeginChangeNoUndo(); 2360_ignoreNextSelectionChange = textEditor.Selection._IsChanged; 2366textEditor.Selection.EndChange(false /* disableScroll */, true /* skipEvents */); 4127get { return this.TextEditor.Selection; }