388 references to Selection
PresentationFramework (388)
MS\Internal\Documents\DocumentGrid.cs (5)
292if (TextEditor != null && TextEditor.Selection != null) 295ITextPointer tp = TextEditor.Selection.Start; 1275ITextRange textRange = TextEditor.Selection; 2544ITextPointer tp = TextEditor.Selection.Start; 2563return (TextEditor != null && TextEditor.Selection != null);
MS\Internal\Documents\DocumentViewerHelper.cs (1)
101textSelection = textEditor.Selection;
System\Windows\Controls\DocumentViewer.cs (1)
1416return TextEditor.Selection;
System\Windows\Controls\PasswordBox.cs (2)
1173_textEditor.Selection.DetachFromVisualTree(); 1249return _textEditor.Selection;
System\Windows\Controls\Primitives\TextBoxBase.cs (8)
387this.TextEditor.Selection.BeginChange(); 395if (this.TextEditor.Selection.ChangeBlockLevel == 0) 400this.TextEditor.Selection.EndChange(); 409return this.TextEditor.Selection.DeclareChangeBlock(); 1479Invariant.Assert(_textEditor.TextContainer.TextSelection == _textEditor.Selection); 1494_textEditor.Selection.Changed += new EventHandler(OnSelectionChangedInternal); 1782return (TextSelection)_textEditor.Selection; 1859_textEditor.Selection.DetachFromVisualTree();
System\windows\Documents\CaretElement.cs (5)
189((TextSelection)_textEditor.Selection).UpdateCaretState(CaretScrollMethod.None); 440if (!_textEditor.Selection.MovingPosition.HasValidLayout && _textEditor.TextView != null && _textEditor.TextView.IsValid) 456if (!_textEditor.Selection.IsEmpty) 460List<TextSegment> textSegments = _textEditor.Selection.TextSegments; 465Geometry geometry = _textEditor.Selection.TextView.GetTightBoundingGeometryFromTextPositions(segment.Start, segment.End);
System\Windows\Documents\ImmComposition.cs (14)
611startNavigator = _editor.Selection.Start.CreatePointer(); 620endNavigator = _editor.Selection.End.CreatePointer(); 629caretNavigator = _editor.Selection.End.CreatePointer(); 730if (!_editor.Selection.End.HasValidLayout) 754rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 968composition.SetCompositionPositions(_editor.Selection.Start, _editor.Selection.End, compositionString); 1082_editor.Selection.BeginChange(); 1129_editor.Selection.Select(caretPosition, caretPosition); 1137_editor.Selection.EndChange(); 1326range = _editor.Selection; 1517ITextRange range = _editor.Selection; 1531_editor.Selection.Select(start, end); 1765_compositionUndoUnit = new TextParentUndoUnit(_editor.Selection);
System\Windows\Documents\Speller.cs (5)
74_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 488_textEditor.Selection.Changed += new EventHandler(OnCaretMoved); 602_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 679if (!_textEditor.Selection.IsEmpty) 699caretPosition = _textEditor.Selection.Start;
System\windows\Documents\TextEditor.cs (8)
305return (textEditor == null) ? null : textEditor.Selection; 444SetText(this.Selection, text, cultureInfo); 447((TextSelection)this.Selection).ApplySpringloadFormatting(); 558bool forceLayoutUpdate = this.Selection.CoversEntireContent; 606this.Selection.ValidateLayout(); 619bool forceLayoutUpdate = this.Selection.CoversEntireContent; 659this.Selection.ValidateLayout(); 1518this.Selection.ExtendSelectionByMouse(cursorPosition, _forceWordSelection, _forceParagraphSelection);
System\windows\Documents\TextEditorCharacters.cs (26)
69if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 81TextSelection selection = (TextSelection)This.Selection; 122if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection.Start is TextPointer)) 129using (This.Selection.DeclareChangeBlock()) 132TextPointer startResetFormatPosition = (TextPointer)This.Selection.Start; 133TextPointer endResetFormatPosition = (TextPointer)This.Selection.End; 135if (This.Selection.IsEmpty) 137TextSegment autoWordRange = TextRangeBase.GetAutoWord(This.Selection); 141((TextSelection)This.Selection).ClearSpringloadFormatting(); 167if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 174object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontWeightProperty); 187if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 194object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontStyleProperty); 200This.Selection.RefreshCaret(); 210if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 217object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(Inline.TextDecorationsProperty); 239if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 246FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 258if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 265FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 286if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 293if (This.Selection.IsEmpty) 296double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty); 328if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 335if (This.Selection.IsEmpty) 338double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty);
System\windows\Documents\TextEditorContextMenu.cs (8)
65if ((e.CursorLeft != KeyboardInvokedSentinel && !This.Selection.Contains(renderScopeMouseDownPoint)) || 66(e.CursorLeft == KeyboardInvokedSentinel && This.Selection.IsEmpty)) 71else if ((This.Selection.IsEmpty || e.TargetElement is TextElement) && 81TextPointer start = GetContentPosition(This.Selection.Start) as TextPointer; 116using (This.Selection.DeclareChangeBlock()) // NB: This raises a PUBLIC EVENT. 119if (!This.Selection.Contains(renderScopeMouseDownPoint)) 188position = This.Selection.Start; 249This.Selection.UpdateCaretAndHighlight();
System\windows\Documents\TextEditorCopyPaste.cs (39)
74string textString = This.Selection.Text; 102string xamlTextWithImages = WpfPayload.SaveRange(This.Selection, ref wpfContainerMemory, /*useFlowDocumentAsRoot:*/false); 125Image image = This.Selection.GetUIElementSelected() as Image; 136TextRangeSerialization.WriteXaml(xmlWriter, This.Selection, /*useFlowDocumentAsRoot:*/false, /*wpfPayload:*/null); 277if (This.Selection != null && !This.Selection.IsEmpty) 300using (This.Selection.DeclareChangeBlock()) 304This.Selection.Text = String.Empty; 307if (This.Selection is TextSelection) 309((TextSelection)This.Selection).ClearSpringloadFormatting(); 325if (This.Selection != null && !This.Selection.IsEmpty) 356if (This.Selection.IsTableCellRange) 384bool forceLayoutUpdate = This.Selection.CoversEntireContent; 388using (This.Selection.DeclareChangeBlock()) 398This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 401if (This.Selection is TextSelection) 403((TextSelection)This.Selection).ClearSpringloadFormatting(); 413This.Selection.ValidateLayout(); 497args.CanExecute = !This.Selection.IsEmpty; 542args.CanExecute = !This.Selection.IsEmpty; 679if (This.AcceptsRichContent && This.Selection is TextSelection) 700if (This.AcceptsRichContent && This.Selection is TextSelection) 714((TextSelection)This.Selection).InsertEmbeddedUIElement((FrameworkElement)element); 742if (This.AcceptsRichContent && This.Selection is TextSelection) 877This.Selection.BeginChange(); 880((TextRange)This.Selection).SetXmlVirtual(sectionOrSpan); 883TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.Start); 884TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.End); 887TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.Start); 888TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.End); 894This.Selection.EndChange(); 938pastedText = This._FilterText(pastedText, This.Selection); 942if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 945This.Selection.Text = String.Empty; 948TextPointer start = TextRangeEditTables.EnsureInsertionPosition((TextPointer)This.Selection.Start); 990This.Selection.Select(start, end); 995This.Selection.Text = pastedText;
System\windows\Documents\TextEditorDragDrop.cs (4)
92ITextSelection selection = _textEditor.Selection; 130_textEditor.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 153ITextSelection selection = _textEditor.Selection; 508ITextSelection selection = _textEditor.Selection;
System\windows\Documents\TextEditorLists.cs (6)
40TextSelection thisSelection = (TextSelection)This.Selection; 67if (This != null && This._IsEnabled && !This.IsReadOnly && !This.Selection.IsTableCellRange) 110if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 117if (!TextRangeEditLists.IsListOperationApplicable((TextSelection)This.Selection)) 122using (This.Selection.DeclareChangeBlock()) 124TextSelection thisSelection = (TextSelection)This.Selection;
System\windows\Documents\TextEditorMouse.cs (21)
81if (This.Selection is TextSelection) 83((TextSelection)This.Selection).ClearSpringloadFormatting(); 98This.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 101else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 106This.Selection.SelectWord(cursorPosition); 115This.Selection.SelectParagraph(cursorPosition); 252This.Selection.BeginChange(); 263This.Selection.EndChange(); 350using (This.Selection.DeclareChangeBlock()) 358using (This.Selection.DeclareChangeBlock()) 456Invariant.Assert(This.Selection != null); 484Invariant.Assert(This.Selection != null); 490Invariant.Assert(This.Selection != null); 501Invariant.Assert(This.Selection != null); 558using (This.Selection.DeclareChangeBlock()) 573This.Selection.ExtendSelectionByMouse(snappedCursorPosition, This._forceWordSelection, This._forceParagraphSelection); 618ITextSelection selection = This.Selection; 687if (This.Selection != null && !This.UiScope.IsMouseCaptured) 689if (This.Selection.IsEmpty) 698else if (This.UiScope.IsFocused && This.Selection.Contains(mouseMovePoint)) 762CaretElement caretElement = textEditor.Selection.CaretElement;
System\windows\Documents\TextEditorSelection.cs (117)
155using (This.Selection.DeclareChangeBlock(true /* disableScroll */)) 157This.Selection.Select(This.TextContainer.Start, This.TextContainer.End); 253if (!This.Selection.End.ValidateLayout()) 258using (This.Selection.DeclareChangeBlock()) 260if (!This.Selection.IsEmpty) 270This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 273Invariant.Assert(This.Selection.IsEmpty); 290ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, +1, out newSuggestedX, out linesMoved); 299This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 314This.Selection.SetCaretToPosition(nextPosition ?? lineEndPosition, 345if (!This.Selection.Start.ValidateLayout()) 350using (This.Selection.DeclareChangeBlock()) 352if (!This.Selection.IsEmpty) 359This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 362Invariant.Assert(This.Selection.IsEmpty); 379ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, -1, out newSuggestedX, out linesMoved); 389This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 404This.Selection.SetCaretToPosition(previousPosition ?? lineStartPosition, 434using (This.Selection.DeclareChangeBlock()) 446if (!This.Selection.IsEmpty) 456This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 459ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 468This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 473This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 489using (This.Selection.DeclareChangeBlock()) 501if (!This.Selection.IsEmpty) 508This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 510ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 514if (This.Selection.Start.CompareTo(paragraphRange.Start) > 0) 517This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 526This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 544if (!This.Selection.End.ValidateLayout()) 549using (This.Selection.DeclareChangeBlock()) 551if (!This.Selection.IsEmpty) 561This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 603This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 641This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 664if (!This.Selection.Start.ValidateLayout()) 669using (This.Selection.DeclareChangeBlock()) 671if (!This.Selection.IsEmpty) 678This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 717This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 755This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/ 797using (This.Selection.DeclareChangeBlock()) 806This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 848using (This.Selection.DeclareChangeBlock()) 858This.Selection.SetCaretToPosition(caretPosition, orientation, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 884using (This.Selection.DeclareChangeBlock()) 886This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 912using (This.Selection.DeclareChangeBlock()) 915This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1010using (This.Selection.DeclareChangeBlock()) 1012if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1182using (This.Selection.DeclareChangeBlock()) 1184if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1305using (This.Selection.DeclareChangeBlock()) 1316ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1346using (This.Selection.DeclareChangeBlock()) 1357ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1399using (This.Selection.DeclareChangeBlock()) 1495using (This.Selection.DeclareChangeBlock()) 1600using (This.Selection.DeclareChangeBlock()) 1646if (lineRange.End.CompareTo(This.Selection.End) < 0) 1651using (This.Selection.DeclareChangeBlock()) 1660if (This.Selection.AnchorPosition.ValidateLayout()) 1662TextSegment anchorLineRange = TextEditorSelection.GetNormalizedLineRange(This.TextView, This.Selection.AnchorPosition); 1663if (!lineRange.IsNull && anchorLineRange.Start.CompareTo(This.Selection.AnchorPosition) == 0) 1670TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1717using (This.Selection.DeclareChangeBlock()) 1745using (This.Selection.DeclareChangeBlock()) 1779using (This.Selection.DeclareChangeBlock()) 1785This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1809using (This.Selection.DeclareChangeBlock()) 1815This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1841using (This.Selection.DeclareChangeBlock()) 1904using (This.Selection.DeclareChangeBlock()) 2008if (This.Selection is TextSelection) 2010((TextSelection)This.Selection).ClearSpringloadFormatting(); 2021ITextPointer position = textEditor.Selection.MovingPosition.CreatePointer(); 2044using (textEditor.Selection.DeclareChangeBlock()) 2049textEditor.Selection.ExtendToNextInsertionPosition(direction); 2052BringIntoView(textEditor.Selection.MovingPosition, textEditor); 2057ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2059if (textEditor.Selection.IsEmpty) 2077textEditor.Selection.SetCaretToPosition(movingEnd, contentDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2082textEditor.Selection.OnCaretNavigation(); 2104using (textEditor.Selection.DeclareChangeBlock()) 2118if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2121textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2127ITextPointer wordBoundary = textEditor.Selection.End.CreatePointer(); 2130textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2138if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2141textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2147ITextPointer wordBoundary = textEditor.Selection.Start.CreatePointer(); 2150textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2157textEditor.Selection.OnCaretNavigation(); 2179using (textEditor.Selection.DeclareChangeBlock()) 2191ITextPointer wordBoundary = textEditor.Selection.MovingPosition.CreatePointer(); 2200textEditor.Selection.OnCaretNavigation(); 2240if (This.Selection.MovingPosition.CompareTo(innerMovingPosition) > 0) 2303ITextPointer movingPosition = This.Selection.MovingPosition; 2307This.Selection.Start.CompareTo(movingPosition) < 0 && 2333return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2345ITextPointer end = This.Selection.End; 2346if (end.CompareTo(This.Selection.MovingPosition) == 0) 2372textEditor.Selection.ExtendToPosition(position); 2394if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.Start)) 2396ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2399This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
System\windows\Documents\TextEditorSpelling.cs (15)
49if (IsSelectionIgnoringErrors(This.Selection)) 59LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 62ITextPointer position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 68position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 80if (This.Selection.IsEmpty) 83position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 88position = GetNextNonWhiteSpacePosition(This.Selection.Start, This.Selection.End); 92position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 134using (This.Selection.DeclareChangeBlock()) 152This.Selection.Select(spellingError.Start, spellingError.End); 158((TextSelection)This.Selection).SpringloadCurrentFormatting(); 166caretPosition = This.Selection.End; 170This.Selection.Select(caretPosition, caretPosition);
System\windows\Documents\TextEditorTables.cs (8)
56if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 69((TextSelection)This.Selection).InsertTable(/*rowCount:*/4, /*columnCount:*/4); 73((TextSelection)This.Selection).InsertRows(+1); 77((TextSelection)This.Selection).InsertColumns(+1); 81((TextSelection)This.Selection).DeleteRows(); 85((TextSelection)This.Selection).DeleteColumns(); 89((TextSelection)This.Selection).MergeCells(); 93((TextSelection)This.Selection).SplitCell(1000, 1000); // Split all ways to possible maximum
System\windows\Documents\TextEditorTyping.cs (89)
275This.SetText(This.Selection, String.Empty, InputLanguageManager.Current.CurrentInputLanguage); 533((TextSelection)This.Selection).ClearSpringloadFormatting(); 538using (This.Selection.DeclareChangeBlock()) 540ITextPointer position = This.Selection.End; 541if (This.Selection.IsEmpty) 566This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 570This.Selection.Text = String.Empty; 588using (This.Selection.DeclareChangeBlock()) 590ITextPointer position = This.Selection.Start; 600if (This.Selection.IsEmpty) 609TextRangeEditLists.ConvertListItemsToParagraphs((TextRange)This.Selection); 612(IsAtListItemChildStart(position, false /* emptyChildOnly */) || IsAtIndentedParagraphOrBlockUIContainerStart(This.Selection.Start))) 625((TextSelection)This.Selection).ClearSpringloadFormatting(); 632((TextSelection)This.Selection).ClearSpringloadFormatting(); 674This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 684This.Selection.Select(This.Selection.End, backspacePosition); 691This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 700((TextSelection)This.Selection).ClearSpringloadFormatting(); 701((TextSelection)This.Selection).SpringloadCurrentFormatting(); 715This.Selection.Text = String.Empty; 716position = This.Selection.Start; 723This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 771This.Selection.SetCaretToPosition(deletePosition, directionOfDelete, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 776((TextSelection)This.Selection).ClearSpringloadFormatting(); 898if (This.Selection.IsTableCellRange) 905ITextPointer wordBoundary = This.Selection.End.CreatePointer(); 911if (This.Selection.IsEmpty) 916if (TextRangeEditTables.IsTableStructureCrossed(This.Selection.Start, wordBoundary)) 921ITextRange textRange = new TextRange(This.Selection.Start, wordBoundary); 931using (This.Selection.DeclareChangeBlock()) 936((TextSelection)This.Selection).ClearSpringloadFormatting(); 939This.Selection.Select(textRange.Start, textRange.End); 942This.Selection.Text = String.Empty; 956if (This.Selection.IsTableCellRange) 964ITextPointer wordBoundary = This.Selection.Start.CreatePointer(); 970if (This.Selection.IsEmpty) 976if (TextRangeEditTables.IsTableStructureCrossed(wordBoundary, This.Selection.Start)) 983ITextRange textRange = new TextRange(wordBoundary, This.Selection.End); 993using (This.Selection.DeclareChangeBlock()) 998((TextSelection)This.Selection).ClearSpringloadFormatting(); 999This.Selection.Select(textRange.Start, textRange.End); 1000((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1004This.Selection.Select(textRange.Start, textRange.End); 1008This.Selection.Text = String.Empty; 1032if (This.Selection.IsTableCellRange || !This.AcceptsReturn) 1051if (This.Selection.IsTableCellRange || !This.AcceptsReturn || !This.UiScope.IsKeyboardFocused) 1059using (This.Selection.DeclareChangeBlock()) 1066if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 1081This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1095((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1097if (!This.Selection.IsEmpty) 1100This.Selection.Text = String.Empty; 1110TextPointer newEnd = ((TextSelection)This.Selection).End; 1131This.Selection.Select(newEnd, newEnd); 1144string filteredText = This._FilterText(Environment.NewLine, This.Selection); 1148This.Selection.Text = Environment.NewLine; 1163Invariant.Assert(This.Selection.Start is TextPointer); 1164TextPointer position = (TextPointer)This.Selection.Start; 1171TextRange range = ((TextSelection)This.Selection).InsertRows(+1); 1172This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1174else if (This.Selection.IsEmpty && 1195This.Selection.Select(newEnd, newEnd); 1218using (This.Selection.DeclareChangeBlock()) 1222if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1225((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.LeftToRight, /*applyToParagraphs*/true); 1238if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1241((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.RightToLeft, /*applyToParagraphs*/true); 1250((TextSelection)This.Selection).UpdateCaretState(CaretScrollMethod.Simple); 1350if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1382if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1404if (This.Selection.IsTableCellRange) 1408This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1412if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.End)) 1416TableRow row = ((TextPointer)This.Selection.End).Parent as TableRow; 1438This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1444TextElement parent = ((TextPointer)This.Selection.Start).Parent as TextElement; 1490This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1537string filteredText = This._FilterText(textData, This.Selection); 1549using (This.Selection.DeclareChangeBlock()) 1551This.Selection.ApplyTypingHeuristics(This.AllowOvertype && This._OvertypeMode && filteredText != "\t"); 1556ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1559This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1802This._typingUndoUnit = new TextParentUndoUnit(This.Selection);
System\windows\Documents\TextSelection.cs (2)
771RefreshCaret(_textEditor, _textEditor.Selection); 1642focusedTextSelection = textEditor.Selection;
System\Windows\Documents\TextStore.cs (4)
2349textEditor.Selection.BeginChangeNoUndo(); 2367_ignoreNextSelectionChange = textEditor.Selection._IsChanged; 2373textEditor.Selection.EndChange(false /* disableScroll */, true /* skipEvents */); 4137get { return this.TextEditor.Selection; }