388 references to Selection
PresentationFramework (388)
MS\Internal\Documents\DocumentGrid.cs (5)
299if (TextEditor != null && TextEditor.Selection != null) 302ITextPointer tp = TextEditor.Selection.Start; 1282ITextRange textRange = TextEditor.Selection; 2546ITextPointer tp = TextEditor.Selection.Start; 2565return (TextEditor != null && TextEditor.Selection != null);
MS\Internal\Documents\DocumentViewerHelper.cs (1)
103textSelection = textEditor.Selection;
System\Windows\Controls\DocumentViewer.cs (1)
1428return TextEditor.Selection;
System\Windows\Controls\PasswordBox.cs (2)
1190_textEditor.Selection.DetachFromVisualTree(); 1266return _textEditor.Selection;
System\Windows\Controls\Primitives\TextBoxBase.cs (8)
394this.TextEditor.Selection.BeginChange(); 402if (this.TextEditor.Selection.ChangeBlockLevel == 0) 407this.TextEditor.Selection.EndChange(); 416return this.TextEditor.Selection.DeclareChangeBlock(); 1486Invariant.Assert(_textEditor.TextContainer.TextSelection == _textEditor.Selection); 1501_textEditor.Selection.Changed += new EventHandler(OnSelectionChangedInternal); 1789return (TextSelection)_textEditor.Selection; 1866_textEditor.Selection.DetachFromVisualTree();
System\windows\Documents\CaretElement.cs (5)
193((TextSelection)_textEditor.Selection).UpdateCaretState(CaretScrollMethod.None); 444if (!_textEditor.Selection.MovingPosition.HasValidLayout && _textEditor.TextView != null && _textEditor.TextView.IsValid) 460if (!_textEditor.Selection.IsEmpty) 464List<TextSegment> textSegments = _textEditor.Selection.TextSegments; 469Geometry geometry = _textEditor.Selection.TextView.GetTightBoundingGeometryFromTextPositions(segment.Start, segment.End);
System\Windows\Documents\ImmComposition.cs (14)
634startNavigator = _editor.Selection.Start.CreatePointer(); 643endNavigator = _editor.Selection.End.CreatePointer(); 652caretNavigator = _editor.Selection.End.CreatePointer(); 753if (!_editor.Selection.End.HasValidLayout) 777rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 989composition.SetCompositionPositions(_editor.Selection.Start, _editor.Selection.End, compositionString); 1103_editor.Selection.BeginChange(); 1150_editor.Selection.Select(caretPosition, caretPosition); 1158_editor.Selection.EndChange(); 1347range = _editor.Selection; 1538ITextRange range = _editor.Selection; 1552_editor.Selection.Select(start, end); 1786_compositionUndoUnit = new TextParentUndoUnit(_editor.Selection);
System\Windows\Documents\Speller.cs (5)
78_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 504_textEditor.Selection.Changed += new EventHandler(OnCaretMoved); 618_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 695if (!_textEditor.Selection.IsEmpty) 715caretPosition = _textEditor.Selection.Start;
System\windows\Documents\TextEditor.cs (8)
316return (textEditor == null) ? null : textEditor.Selection; 455SetText(this.Selection, text, cultureInfo); 458((TextSelection)this.Selection).ApplySpringloadFormatting(); 567bool forceLayoutUpdate = this.Selection.CoversEntireContent; 615this.Selection.ValidateLayout(); 628bool forceLayoutUpdate = this.Selection.CoversEntireContent; 668this.Selection.ValidateLayout(); 1527this.Selection.ExtendSelectionByMouse(cursorPosition, _forceWordSelection, _forceParagraphSelection);
System\windows\Documents\TextEditorCharacters.cs (26)
85if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 97TextSelection selection = (TextSelection)This.Selection; 138if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection.Start is TextPointer)) 145using (This.Selection.DeclareChangeBlock()) 148TextPointer startResetFormatPosition = (TextPointer)This.Selection.Start; 149TextPointer endResetFormatPosition = (TextPointer)This.Selection.End; 151if (This.Selection.IsEmpty) 153TextSegment autoWordRange = TextRangeBase.GetAutoWord(This.Selection); 157((TextSelection)This.Selection).ClearSpringloadFormatting(); 183if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 190object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontWeightProperty); 203if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 210object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontStyleProperty); 216This.Selection.RefreshCaret(); 226if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 233object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(Inline.TextDecorationsProperty); 255if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 262FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 274if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 281FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 302if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 309if (This.Selection.IsEmpty) 312double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty); 344if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 351if (This.Selection.IsEmpty) 354double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty);
System\windows\Documents\TextEditorContextMenu.cs (8)
67if ((e.CursorLeft != KeyboardInvokedSentinel && !This.Selection.Contains(renderScopeMouseDownPoint)) || 68(e.CursorLeft == KeyboardInvokedSentinel && This.Selection.IsEmpty)) 73else if ((This.Selection.IsEmpty || e.TargetElement is TextElement) && 83TextPointer start = GetContentPosition(This.Selection.Start) as TextPointer; 118using (This.Selection.DeclareChangeBlock()) // NB: This raises a PUBLIC EVENT. 121if (!This.Selection.Contains(renderScopeMouseDownPoint)) 190position = This.Selection.Start; 251This.Selection.UpdateCaretAndHighlight();
System\windows\Documents\TextEditorCopyPaste.cs (39)
87string textString = This.Selection.Text; 115string xamlTextWithImages = WpfPayload.SaveRange(This.Selection, ref wpfContainerMemory, /*useFlowDocumentAsRoot:*/false); 138Image image = This.Selection.GetUIElementSelected() as Image; 149TextRangeSerialization.WriteXaml(xmlWriter, This.Selection, /*useFlowDocumentAsRoot:*/false, /*wpfPayload:*/null); 290if (This.Selection != null && !This.Selection.IsEmpty) 313using (This.Selection.DeclareChangeBlock()) 317This.Selection.Text = String.Empty; 320if (This.Selection is TextSelection) 322((TextSelection)This.Selection).ClearSpringloadFormatting(); 338if (This.Selection != null && !This.Selection.IsEmpty) 369if (This.Selection.IsTableCellRange) 397bool forceLayoutUpdate = This.Selection.CoversEntireContent; 401using (This.Selection.DeclareChangeBlock()) 411This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 414if (This.Selection is TextSelection) 416((TextSelection)This.Selection).ClearSpringloadFormatting(); 426This.Selection.ValidateLayout(); 508args.CanExecute = !This.Selection.IsEmpty; 553args.CanExecute = !This.Selection.IsEmpty; 690if (This.AcceptsRichContent && This.Selection is TextSelection) 711if (This.AcceptsRichContent && This.Selection is TextSelection) 725((TextSelection)This.Selection).InsertEmbeddedUIElement((FrameworkElement)element); 753if (This.AcceptsRichContent && This.Selection is TextSelection) 888This.Selection.BeginChange(); 891((TextRange)This.Selection).SetXmlVirtual(sectionOrSpan); 894TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.Start); 895TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.End); 898TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.Start); 899TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.End); 905This.Selection.EndChange(); 949pastedText = This._FilterText(pastedText, This.Selection); 953if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 956This.Selection.Text = String.Empty; 959TextPointer start = TextRangeEditTables.EnsureInsertionPosition((TextPointer)This.Selection.Start); 1001This.Selection.Select(start, end); 1006This.Selection.Text = pastedText;
System\windows\Documents\TextEditorDragDrop.cs (4)
109ITextSelection selection = _textEditor.Selection; 147_textEditor.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 170ITextSelection selection = _textEditor.Selection; 525ITextSelection selection = _textEditor.Selection;
System\windows\Documents\TextEditorLists.cs (6)
56TextSelection thisSelection = (TextSelection)This.Selection; 83if (This != null && This._IsEnabled && !This.IsReadOnly && !This.Selection.IsTableCellRange) 126if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 133if (!TextRangeEditLists.IsListOperationApplicable((TextSelection)This.Selection)) 138using (This.Selection.DeclareChangeBlock()) 140TextSelection thisSelection = (TextSelection)This.Selection;
System\windows\Documents\TextEditorMouse.cs (21)
95if (This.Selection is TextSelection) 97((TextSelection)This.Selection).ClearSpringloadFormatting(); 112This.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 115else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 120This.Selection.SelectWord(cursorPosition); 129This.Selection.SelectParagraph(cursorPosition); 266This.Selection.BeginChange(); 277This.Selection.EndChange(); 364using (This.Selection.DeclareChangeBlock()) 372using (This.Selection.DeclareChangeBlock()) 470Invariant.Assert(This.Selection != null); 498Invariant.Assert(This.Selection != null); 504Invariant.Assert(This.Selection != null); 515Invariant.Assert(This.Selection != null); 572using (This.Selection.DeclareChangeBlock()) 587This.Selection.ExtendSelectionByMouse(snappedCursorPosition, This._forceWordSelection, This._forceParagraphSelection); 632ITextSelection selection = This.Selection; 701if (This.Selection != null && !This.UiScope.IsMouseCaptured) 703if (This.Selection.IsEmpty) 712else if (This.UiScope.IsFocused && This.Selection.Contains(mouseMovePoint)) 776CaretElement caretElement = textEditor.Selection.CaretElement;
System\windows\Documents\TextEditorSelection.cs (117)
170using (This.Selection.DeclareChangeBlock(true /* disableScroll */)) 172This.Selection.Select(This.TextContainer.Start, This.TextContainer.End); 268if (!This.Selection.End.ValidateLayout()) 273using (This.Selection.DeclareChangeBlock()) 275if (!This.Selection.IsEmpty) 285This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 288Invariant.Assert(This.Selection.IsEmpty); 305ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, +1, out newSuggestedX, out linesMoved); 314This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 329This.Selection.SetCaretToPosition(nextPosition != null ? nextPosition : lineEndPosition, 360if (!This.Selection.Start.ValidateLayout()) 365using (This.Selection.DeclareChangeBlock()) 367if (!This.Selection.IsEmpty) 374This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 377Invariant.Assert(This.Selection.IsEmpty); 394ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, -1, out newSuggestedX, out linesMoved); 404This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 419This.Selection.SetCaretToPosition(previousPosition != null ? previousPosition : lineStartPosition, 449using (This.Selection.DeclareChangeBlock()) 461if (!This.Selection.IsEmpty) 471This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 474ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 483This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 488This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 504using (This.Selection.DeclareChangeBlock()) 516if (!This.Selection.IsEmpty) 523This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 525ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 529if (This.Selection.Start.CompareTo(paragraphRange.Start) > 0) 532This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 541This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 559if (!This.Selection.End.ValidateLayout()) 564using (This.Selection.DeclareChangeBlock()) 566if (!This.Selection.IsEmpty) 576This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 618This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 656This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 679if (!This.Selection.Start.ValidateLayout()) 684using (This.Selection.DeclareChangeBlock()) 686if (!This.Selection.IsEmpty) 693This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 732This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 770This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/ 812using (This.Selection.DeclareChangeBlock()) 821This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 863using (This.Selection.DeclareChangeBlock()) 873This.Selection.SetCaretToPosition(caretPosition, orientation, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 899using (This.Selection.DeclareChangeBlock()) 901This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 927using (This.Selection.DeclareChangeBlock()) 930This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1025using (This.Selection.DeclareChangeBlock()) 1027if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1197using (This.Selection.DeclareChangeBlock()) 1199if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1320using (This.Selection.DeclareChangeBlock()) 1331ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1361using (This.Selection.DeclareChangeBlock()) 1372ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1414using (This.Selection.DeclareChangeBlock()) 1510using (This.Selection.DeclareChangeBlock()) 1615using (This.Selection.DeclareChangeBlock()) 1661if (lineRange.End.CompareTo(This.Selection.End) < 0) 1666using (This.Selection.DeclareChangeBlock()) 1675if (This.Selection.AnchorPosition.ValidateLayout()) 1677TextSegment anchorLineRange = TextEditorSelection.GetNormalizedLineRange(This.TextView, This.Selection.AnchorPosition); 1678if (!lineRange.IsNull && anchorLineRange.Start.CompareTo(This.Selection.AnchorPosition) == 0) 1685TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1732using (This.Selection.DeclareChangeBlock()) 1760using (This.Selection.DeclareChangeBlock()) 1794using (This.Selection.DeclareChangeBlock()) 1800This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1824using (This.Selection.DeclareChangeBlock()) 1830This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1856using (This.Selection.DeclareChangeBlock()) 1919using (This.Selection.DeclareChangeBlock()) 2023if (This.Selection is TextSelection) 2025((TextSelection)This.Selection).ClearSpringloadFormatting(); 2036ITextPointer position = textEditor.Selection.MovingPosition.CreatePointer(); 2059using (textEditor.Selection.DeclareChangeBlock()) 2064textEditor.Selection.ExtendToNextInsertionPosition(direction); 2067BringIntoView(textEditor.Selection.MovingPosition, textEditor); 2072ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2074if (textEditor.Selection.IsEmpty) 2092textEditor.Selection.SetCaretToPosition(movingEnd, contentDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2097textEditor.Selection.OnCaretNavigation(); 2119using (textEditor.Selection.DeclareChangeBlock()) 2133if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2136textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2142ITextPointer wordBoundary = textEditor.Selection.End.CreatePointer(); 2145textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2153if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2156textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2162ITextPointer wordBoundary = textEditor.Selection.Start.CreatePointer(); 2165textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2172textEditor.Selection.OnCaretNavigation(); 2194using (textEditor.Selection.DeclareChangeBlock()) 2206ITextPointer wordBoundary = textEditor.Selection.MovingPosition.CreatePointer(); 2215textEditor.Selection.OnCaretNavigation(); 2255if (This.Selection.MovingPosition.CompareTo(innerMovingPosition) > 0) 2318ITextPointer movingPosition = This.Selection.MovingPosition; 2322This.Selection.Start.CompareTo(movingPosition) < 0 && 2348return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2360ITextPointer end = This.Selection.End; 2361if (end.CompareTo(This.Selection.MovingPosition) == 0) 2387textEditor.Selection.ExtendToPosition(position); 2409if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.Start)) 2411ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2414This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
System\windows\Documents\TextEditorSpelling.cs (15)
50if (IsSelectionIgnoringErrors(This.Selection)) 60LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 63ITextPointer position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 69position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 81if (This.Selection.IsEmpty) 84position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 89position = GetNextNonWhiteSpacePosition(This.Selection.Start, This.Selection.End); 93position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 135using (This.Selection.DeclareChangeBlock()) 153This.Selection.Select(spellingError.Start, spellingError.End); 159((TextSelection)This.Selection).SpringloadCurrentFormatting(); 167caretPosition = This.Selection.End; 171This.Selection.Select(caretPosition, caretPosition);
System\windows\Documents\TextEditorTables.cs (8)
73if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 86((TextSelection)This.Selection).InsertTable(/*rowCount:*/4, /*columnCount:*/4); 90((TextSelection)This.Selection).InsertRows(+1); 94((TextSelection)This.Selection).InsertColumns(+1); 98((TextSelection)This.Selection).DeleteRows(); 102((TextSelection)This.Selection).DeleteColumns(); 106((TextSelection)This.Selection).MergeCells(); 110((TextSelection)This.Selection).SplitCell(1000, 1000); // Split all ways to possible maximum
System\windows\Documents\TextEditorTyping.cs (89)
284This.SetText(This.Selection, String.Empty, InputLanguageManager.Current.CurrentInputLanguage); 542((TextSelection)This.Selection).ClearSpringloadFormatting(); 547using (This.Selection.DeclareChangeBlock()) 549ITextPointer position = This.Selection.End; 550if (This.Selection.IsEmpty) 575This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 579This.Selection.Text = String.Empty; 597using (This.Selection.DeclareChangeBlock()) 599ITextPointer position = This.Selection.Start; 609if (This.Selection.IsEmpty) 618TextRangeEditLists.ConvertListItemsToParagraphs((TextRange)This.Selection); 621(IsAtListItemChildStart(position, false /* emptyChildOnly */) || IsAtIndentedParagraphOrBlockUIContainerStart(This.Selection.Start))) 634((TextSelection)This.Selection).ClearSpringloadFormatting(); 641((TextSelection)This.Selection).ClearSpringloadFormatting(); 683This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 693This.Selection.Select(This.Selection.End, backspacePosition); 700This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 709((TextSelection)This.Selection).ClearSpringloadFormatting(); 710((TextSelection)This.Selection).SpringloadCurrentFormatting(); 724This.Selection.Text = String.Empty; 725position = This.Selection.Start; 732This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 780This.Selection.SetCaretToPosition(deletePosition, directionOfDelete, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 785((TextSelection)This.Selection).ClearSpringloadFormatting(); 907if (This.Selection.IsTableCellRange) 914ITextPointer wordBoundary = This.Selection.End.CreatePointer(); 920if (This.Selection.IsEmpty) 925if (TextRangeEditTables.IsTableStructureCrossed(This.Selection.Start, wordBoundary)) 930ITextRange textRange = new TextRange(This.Selection.Start, wordBoundary); 940using (This.Selection.DeclareChangeBlock()) 945((TextSelection)This.Selection).ClearSpringloadFormatting(); 948This.Selection.Select(textRange.Start, textRange.End); 951This.Selection.Text = String.Empty; 965if (This.Selection.IsTableCellRange) 973ITextPointer wordBoundary = This.Selection.Start.CreatePointer(); 979if (This.Selection.IsEmpty) 985if (TextRangeEditTables.IsTableStructureCrossed(wordBoundary, This.Selection.Start)) 992ITextRange textRange = new TextRange(wordBoundary, This.Selection.End); 1002using (This.Selection.DeclareChangeBlock()) 1007((TextSelection)This.Selection).ClearSpringloadFormatting(); 1008This.Selection.Select(textRange.Start, textRange.End); 1009((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1013This.Selection.Select(textRange.Start, textRange.End); 1017This.Selection.Text = String.Empty; 1041if (This.Selection.IsTableCellRange || !This.AcceptsReturn) 1060if (This.Selection.IsTableCellRange || !This.AcceptsReturn || !This.UiScope.IsKeyboardFocused) 1068using (This.Selection.DeclareChangeBlock()) 1075if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 1090This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1104((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1106if (!This.Selection.IsEmpty) 1109This.Selection.Text = String.Empty; 1119TextPointer newEnd = ((TextSelection)This.Selection).End; 1140This.Selection.Select(newEnd, newEnd); 1153string filteredText = This._FilterText(Environment.NewLine, This.Selection); 1157This.Selection.Text = Environment.NewLine; 1172Invariant.Assert(This.Selection.Start is TextPointer); 1173TextPointer position = (TextPointer)This.Selection.Start; 1180TextRange range = ((TextSelection)This.Selection).InsertRows(+1); 1181This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1183else if (This.Selection.IsEmpty && 1204This.Selection.Select(newEnd, newEnd); 1227using (This.Selection.DeclareChangeBlock()) 1231if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1234((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.LeftToRight, /*applyToParagraphs*/true); 1247if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1250((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.RightToLeft, /*applyToParagraphs*/true); 1259((TextSelection)This.Selection).UpdateCaretState(CaretScrollMethod.Simple); 1359if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1391if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1413if (This.Selection.IsTableCellRange) 1417This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1421if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.End)) 1425TableRow row = ((TextPointer)This.Selection.End).Parent as TableRow; 1447This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1453TextElement parent = ((TextPointer)This.Selection.Start).Parent as TextElement; 1499This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1546string filteredText = This._FilterText(textData, This.Selection); 1558using (This.Selection.DeclareChangeBlock()) 1560This.Selection.ApplyTypingHeuristics(This.AllowOvertype && This._OvertypeMode && filteredText != "\t"); 1565ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1568This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1811This._typingUndoUnit = new TextParentUndoUnit(This.Selection);
System\windows\Documents\TextSelection.cs (2)
774RefreshCaret(_textEditor, _textEditor.Selection); 1645focusedTextSelection = textEditor.Selection;
System\Windows\Documents\TextStore.cs (4)
2369textEditor.Selection.BeginChangeNoUndo(); 2387_ignoreNextSelectionChange = textEditor.Selection._IsChanged; 2393textEditor.Selection.EndChange(false /* disableScroll */, true /* skipEvents */); 4155get { return this.TextEditor.Selection; }