388 references to Selection
PresentationFramework (388)
src\Framework\MS\Internal\Documents\DocumentGrid.cs (5)
306if (TextEditor != null && TextEditor.Selection != null) 309ITextPointer tp = TextEditor.Selection.Start; 1307ITextRange textRange = TextEditor.Selection; 2588ITextPointer tp = TextEditor.Selection.Start; 2607return (TextEditor != null && TextEditor.Selection != null);
src\Framework\MS\Internal\Documents\DocumentViewerHelper.cs (1)
118textSelection = textEditor.Selection;
src\Framework\System\Windows\Controls\DocumentViewer.cs (1)
1448return TextEditor.Selection;
src\Framework\System\Windows\Controls\PasswordBox.cs (2)
1213_textEditor.Selection.DetachFromVisualTree(); 1300return _textEditor.Selection;
src\Framework\System\Windows\Controls\Primitives\TextBoxBase.cs (8)
417this.TextEditor.Selection.BeginChange(); 425if (this.TextEditor.Selection.ChangeBlockLevel == 0) 430this.TextEditor.Selection.EndChange(); 439return this.TextEditor.Selection.DeclareChangeBlock(); 1512Invariant.Assert(_textEditor.TextContainer.TextSelection == _textEditor.Selection); 1527_textEditor.Selection.Changed += new EventHandler(OnSelectionChangedInternal); 1820return (TextSelection)_textEditor.Selection; 1897_textEditor.Selection.DetachFromVisualTree();
src\Framework\System\windows\Documents\CaretElement.cs (5)
196((TextSelection)_textEditor.Selection).UpdateCaretState(CaretScrollMethod.None); 448if (!_textEditor.Selection.MovingPosition.HasValidLayout && _textEditor.TextView != null && _textEditor.TextView.IsValid) 464if (!_textEditor.Selection.IsEmpty) 468List<TextSegment> textSegments = _textEditor.Selection.TextSegments; 473Geometry geometry = _textEditor.Selection.TextView.GetTightBoundingGeometryFromTextPositions(segment.Start, segment.End);
src\Framework\System\Windows\Documents\ImmComposition.cs (14)
730startNavigator = _editor.Selection.Start.CreatePointer(); 739endNavigator = _editor.Selection.End.CreatePointer(); 748caretNavigator = _editor.Selection.End.CreatePointer(); 865if (!_editor.Selection.End.HasValidLayout) 889rectCaret = view.GetRectangleFromTextPosition(_editor.Selection.End.CreatePointer(LogicalDirection.Backward)); 1111composition.SetCompositionPositions(_editor.Selection.Start, _editor.Selection.End, compositionString); 1235_editor.Selection.BeginChange(); 1282_editor.Selection.Select(caretPosition, caretPosition); 1290_editor.Selection.EndChange(); 1488range = _editor.Selection; 1689ITextRange range = _editor.Selection; 1703_editor.Selection.Select(start, end); 1976_compositionUndoUnit = new TextParentUndoUnit(_editor.Selection);
src\Framework\System\Windows\Documents\Speller.cs (5)
83_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 554_textEditor.Selection.Changed += new EventHandler(OnCaretMoved); 668_textEditor.Selection.Changed -= new EventHandler(OnCaretMoved); 750if (!_textEditor.Selection.IsEmpty) 770caretPosition = _textEditor.Selection.Start;
src\Framework\System\windows\Documents\TextEditor.cs (8)
326return (textEditor == null) ? null : textEditor.Selection; 470SetText(this.Selection, text, cultureInfo); 473((TextSelection)this.Selection).ApplySpringloadFormatting(); 594bool forceLayoutUpdate = this.Selection.CoversEntireContent; 642this.Selection.ValidateLayout(); 655bool forceLayoutUpdate = this.Selection.CoversEntireContent; 695this.Selection.ValidateLayout(); 1555this.Selection.ExtendSelectionByMouse(cursorPosition, _forceWordSelection, _forceParagraphSelection);
src\Framework\System\windows\Documents\TextEditorCharacters.cs (26)
87if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 99TextSelection selection = (TextSelection)This.Selection; 140if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection.Start is TextPointer)) 147using (This.Selection.DeclareChangeBlock()) 150TextPointer startResetFormatPosition = (TextPointer)This.Selection.Start; 151TextPointer endResetFormatPosition = (TextPointer)This.Selection.End; 153if (This.Selection.IsEmpty) 155TextSegment autoWordRange = TextRangeBase.GetAutoWord(This.Selection); 159((TextSelection)This.Selection).ClearSpringloadFormatting(); 185if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 192object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontWeightProperty); 205if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 212object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(TextElement.FontStyleProperty); 218This.Selection.RefreshCaret(); 228if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 235object propertyValue = ((TextSelection)This.Selection).GetCurrentValue(Inline.TextDecorationsProperty); 257if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 264FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 276if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 283FontVariants fontVariants = (FontVariants)((TextSelection)This.Selection).GetCurrentValue(Typography.VariantsProperty); 304if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 311if (This.Selection.IsEmpty) 314double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty); 346if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 353if (This.Selection.IsEmpty) 356double fontSize = (double)((TextSelection)This.Selection).GetCurrentValue(TextElement.FontSizeProperty);
src\Framework\System\windows\Documents\TextEditorContextMenu.cs (8)
76if ((e.CursorLeft != KeyboardInvokedSentinel && !This.Selection.Contains(renderScopeMouseDownPoint)) || 77(e.CursorLeft == KeyboardInvokedSentinel && This.Selection.IsEmpty)) 82else if ((This.Selection.IsEmpty || e.TargetElement is TextElement) && 92TextPointer start = GetContentPosition(This.Selection.Start) as TextPointer; 127using (This.Selection.DeclareChangeBlock()) // NB: This raises a PUBLIC EVENT. 130if (!This.Selection.Contains(renderScopeMouseDownPoint)) 199position = This.Selection.Start; 260This.Selection.UpdateCaretAndHighlight();
src\Framework\System\windows\Documents\TextEditorCopyPaste.cs (39)
116string textString = This.Selection.Text; 152string xamlTextWithImages = WpfPayload.SaveRange(This.Selection, ref wpfContainerMemory, /*useFlowDocumentAsRoot:*/false); 176Image image = This.Selection.GetUIElementSelected() as Image; 187TextRangeSerialization.WriteXaml(xmlWriter, This.Selection, /*useFlowDocumentAsRoot:*/false, /*wpfPayload:*/null); 372if (This.Selection != null && !This.Selection.IsEmpty) 395using (This.Selection.DeclareChangeBlock()) 399This.Selection.Text = String.Empty; 402if (This.Selection is TextSelection) 404((TextSelection)This.Selection).ClearSpringloadFormatting(); 443if (This.Selection != null && !This.Selection.IsEmpty) 484if (This.Selection.IsTableCellRange) 512bool forceLayoutUpdate = This.Selection.CoversEntireContent; 516using (This.Selection.DeclareChangeBlock()) 526This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 529if (This.Selection is TextSelection) 531((TextSelection)This.Selection).ClearSpringloadFormatting(); 541This.Selection.ValidateLayout(); 623args.CanExecute = !This.Selection.IsEmpty; 675args.CanExecute = !This.Selection.IsEmpty; 857if (This.AcceptsRichContent && This.Selection is TextSelection && 881if (This.AcceptsRichContent && This.Selection is TextSelection && 896((TextSelection)This.Selection).InsertEmbeddedUIElement((FrameworkElement)element); 924if (This.AcceptsRichContent && This.Selection is TextSelection) 1064This.Selection.BeginChange(); 1067((TextRange)This.Selection).SetXmlVirtual(sectionOrSpan); 1070TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.Start); 1071TextRangeEditLists.MergeListsAroundNormalizedPosition((TextPointer)This.Selection.End); 1074TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.Start); 1075TextRangeEdit.MergeFlowDirection((TextPointer)This.Selection.End); 1081This.Selection.EndChange(); 1126pastedText = This._FilterText(pastedText, This.Selection); 1130if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 1133This.Selection.Text = String.Empty; 1136TextPointer start = TextRangeEditTables.EnsureInsertionPosition((TextPointer)This.Selection.Start); 1178This.Selection.Select(start, end); 1183This.Selection.Text = pastedText;
src\Framework\System\windows\Documents\TextEditorDragDrop.cs (4)
112ITextSelection selection = _textEditor.Selection; 150_textEditor.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 181ITextSelection selection = _textEditor.Selection; 537ITextSelection selection = _textEditor.Selection;
src\Framework\System\windows\Documents\TextEditorLists.cs (6)
58TextSelection thisSelection = (TextSelection)This.Selection; 85if (This != null && This._IsEnabled && !This.IsReadOnly && !This.Selection.IsTableCellRange) 128if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 135if (!TextRangeEditLists.IsListOperationApplicable((TextSelection)This.Selection)) 140using (This.Selection.DeclareChangeBlock()) 142TextSelection thisSelection = (TextSelection)This.Selection;
src\Framework\System\windows\Documents\TextEditorMouse.cs (21)
97if (This.Selection is TextSelection) 99((TextSelection)This.Selection).ClearSpringloadFormatting(); 114This.Selection.SetSelectionByMouse(cursorPosition, mouseDownPoint); 117else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 122This.Selection.SelectWord(cursorPosition); 131This.Selection.SelectParagraph(cursorPosition); 268This.Selection.BeginChange(); 279This.Selection.EndChange(); 366using (This.Selection.DeclareChangeBlock()) 374using (This.Selection.DeclareChangeBlock()) 472Invariant.Assert(This.Selection != null); 500Invariant.Assert(This.Selection != null); 506Invariant.Assert(This.Selection != null); 517Invariant.Assert(This.Selection != null); 574using (This.Selection.DeclareChangeBlock()) 589This.Selection.ExtendSelectionByMouse(snappedCursorPosition, This._forceWordSelection, This._forceParagraphSelection); 633ITextSelection selection = This.Selection; 702if (This.Selection != null && !This.UiScope.IsMouseCaptured) 704if (This.Selection.IsEmpty) 713else if (This.UiScope.IsFocused && This.Selection.Contains(mouseMovePoint)) 777CaretElement caretElement = textEditor.Selection.CaretElement;
src\Framework\System\windows\Documents\TextEditorSelection.cs (117)
178using (This.Selection.DeclareChangeBlock(true /* disableScroll */)) 180This.Selection.Select(This.TextContainer.Start, This.TextContainer.End); 276if (!This.Selection.End.ValidateLayout()) 281using (This.Selection.DeclareChangeBlock()) 283if (!This.Selection.IsEmpty) 293This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 296Invariant.Assert(This.Selection.IsEmpty); 313ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, +1, out newSuggestedX, out linesMoved); 322This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 337This.Selection.SetCaretToPosition(nextPosition != null ? nextPosition : lineEndPosition, 368if (!This.Selection.Start.ValidateLayout()) 373using (This.Selection.DeclareChangeBlock()) 375if (!This.Selection.IsEmpty) 382This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 385Invariant.Assert(This.Selection.IsEmpty); 402ITextPointer newMovingPosition = This.TextView.GetPositionAtNextLine(This.Selection.MovingPosition, suggestedX, -1, out newSuggestedX, out linesMoved); 412This.Selection.SetCaretToPosition(newMovingPosition, newMovingPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 427This.Selection.SetCaretToPosition(previousPosition != null ? previousPosition : lineStartPosition, 457using (This.Selection.DeclareChangeBlock()) 469if (!This.Selection.IsEmpty) 479This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 482ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 491This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 496This.Selection.SetCaretToPosition(paragraphRange.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 512using (This.Selection.DeclareChangeBlock()) 524if (!This.Selection.IsEmpty) 531This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 533ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 537if (This.Selection.Start.CompareTo(paragraphRange.Start) > 0) 540This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 549This.Selection.SetCaretToPosition(paragraphRange.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 567if (!This.Selection.End.ValidateLayout()) 572using (This.Selection.DeclareChangeBlock()) 574if (!This.Selection.IsEmpty) 584This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 627This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 665This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 688if (!This.Selection.Start.ValidateLayout()) 693using (This.Selection.DeclareChangeBlock()) 695if (!This.Selection.IsEmpty) 702This.Selection.SetCaretToPosition(position, position.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 741This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/false); 779This.Selection.SetCaretToPosition(targetPosition, targetPosition.LogicalDirection, /*allowStopAtLineEnd:*/ 821using (This.Selection.DeclareChangeBlock()) 830This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Forward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 872using (This.Selection.DeclareChangeBlock()) 882This.Selection.SetCaretToPosition(caretPosition, orientation, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 908using (This.Selection.DeclareChangeBlock()) 910This.Selection.SetCaretToPosition(This.TextContainer.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 936using (This.Selection.DeclareChangeBlock()) 939This.Selection.SetCaretToPosition(This.TextContainer.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1034using (This.Selection.DeclareChangeBlock()) 1036if (This.Selection.ExtendToNextTableRow(LogicalDirection.Forward)) 1206using (This.Selection.DeclareChangeBlock()) 1208if (This.Selection.ExtendToNextTableRow(LogicalDirection.Backward)) 1329using (This.Selection.DeclareChangeBlock()) 1340ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1370using (This.Selection.DeclareChangeBlock()) 1381ITextPointer movingPointer = This.Selection.MovingPosition.CreatePointer(); 1423using (This.Selection.DeclareChangeBlock()) 1519using (This.Selection.DeclareChangeBlock()) 1624using (This.Selection.DeclareChangeBlock()) 1670if (lineRange.End.CompareTo(This.Selection.End) < 0) 1675using (This.Selection.DeclareChangeBlock()) 1684if (This.Selection.AnchorPosition.ValidateLayout()) 1686TextSegment anchorLineRange = TextEditorSelection.GetNormalizedLineRange(This.TextView, This.Selection.AnchorPosition); 1687if (!lineRange.IsNull && anchorLineRange.Start.CompareTo(This.Selection.AnchorPosition) == 0) 1694TextPointerBase.IsNextToParagraphBreak(This.Selection.AnchorPosition, LogicalDirection.Backward)) 1741using (This.Selection.DeclareChangeBlock()) 1769using (This.Selection.DeclareChangeBlock()) 1803using (This.Selection.DeclareChangeBlock()) 1809This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1833using (This.Selection.DeclareChangeBlock()) 1839This.Selection.SetCaretToPosition(e.NewPosition, e.NewPosition.LogicalDirection, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1865using (This.Selection.DeclareChangeBlock()) 1928using (This.Selection.DeclareChangeBlock()) 2032if (This.Selection is TextSelection) 2034((TextSelection)This.Selection).ClearSpringloadFormatting(); 2045ITextPointer position = textEditor.Selection.MovingPosition.CreatePointer(); 2068using (textEditor.Selection.DeclareChangeBlock()) 2073textEditor.Selection.ExtendToNextInsertionPosition(direction); 2076BringIntoView(textEditor.Selection.MovingPosition, textEditor); 2081ITextPointer movingEnd = (direction == LogicalDirection.Forward ? textEditor.Selection.End : textEditor.Selection.Start); 2083if (textEditor.Selection.IsEmpty) 2101textEditor.Selection.SetCaretToPosition(movingEnd, contentDirection, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2106textEditor.Selection.OnCaretNavigation(); 2128using (textEditor.Selection.DeclareChangeBlock()) 2142if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.End, LogicalDirection.Forward)) 2145textEditor.Selection.SetCaretToPosition(textEditor.Selection.End, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2151ITextPointer wordBoundary = textEditor.Selection.End.CreatePointer(); 2154textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2162if (!textEditor.Selection.IsEmpty && TextPointerBase.IsAtWordBoundary(textEditor.Selection.Start, LogicalDirection.Forward)) 2165textEditor.Selection.SetCaretToPosition(textEditor.Selection.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2171ITextPointer wordBoundary = textEditor.Selection.Start.CreatePointer(); 2174textEditor.Selection.SetCaretToPosition(wordBoundary, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 2181textEditor.Selection.OnCaretNavigation(); 2203using (textEditor.Selection.DeclareChangeBlock()) 2215ITextPointer wordBoundary = textEditor.Selection.MovingPosition.CreatePointer(); 2224textEditor.Selection.OnCaretNavigation(); 2264if (This.Selection.MovingPosition.CompareTo(innerMovingPosition) > 0) 2327ITextPointer movingPosition = This.Selection.MovingPosition; 2331This.Selection.Start.CompareTo(movingPosition) < 0 && 2357return This.Selection.IsEmpty ? This.Selection.Start : This.Selection.Start.GetFrozenPointer(LogicalDirection.Forward); 2369ITextPointer end = This.Selection.End; 2370if (end.CompareTo(This.Selection.MovingPosition) == 0) 2396textEditor.Selection.ExtendToPosition(position); 2418if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.Start)) 2420ITextPointer position = This.Selection.Start.GetNextInsertionPosition(LogicalDirection.Backward); 2423This.Selection.SetCaretToPosition(position, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);
src\Framework\System\windows\Documents\TextEditorSpelling.cs (15)
52if (IsSelectionIgnoringErrors(This.Selection)) 62LogicalDirection direction = This.Selection.IsEmpty ? This.Selection.Start.LogicalDirection : LogicalDirection.Forward; 65ITextPointer position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 71position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 83if (This.Selection.IsEmpty) 86position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 91position = GetNextNonWhiteSpacePosition(This.Selection.Start, This.Selection.End); 95position = GetNextTextPosition(This.Selection.Start, null /* limit */, direction, out character); 137using (This.Selection.DeclareChangeBlock()) 155This.Selection.Select(spellingError.Start, spellingError.End); 161((TextSelection)This.Selection).SpringloadCurrentFormatting(); 169caretPosition = This.Selection.End; 173This.Selection.Select(caretPosition, caretPosition);
src\Framework\System\windows\Documents\TextEditorTables.cs (8)
75if (This == null || !This._IsEnabled || This.IsReadOnly || !This.AcceptsRichContent || !(This.Selection is TextSelection)) 88((TextSelection)This.Selection).InsertTable(/*rowCount:*/4, /*columnCount:*/4); 92((TextSelection)This.Selection).InsertRows(+1); 96((TextSelection)This.Selection).InsertColumns(+1); 100((TextSelection)This.Selection).DeleteRows(); 104((TextSelection)This.Selection).DeleteColumns(); 108((TextSelection)This.Selection).MergeCells(); 112((TextSelection)This.Selection).SplitCell(1000, 1000); // Split all ways to possible maximum
src\Framework\System\windows\Documents\TextEditorTyping.cs (89)
288This.SetText(This.Selection, String.Empty, InputLanguageManager.Current.CurrentInputLanguage); 558((TextSelection)This.Selection).ClearSpringloadFormatting(); 563using (This.Selection.DeclareChangeBlock()) 565ITextPointer position = This.Selection.End; 566if (This.Selection.IsEmpty) 591This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Forward); 595This.Selection.Text = String.Empty; 613using (This.Selection.DeclareChangeBlock()) 615ITextPointer position = This.Selection.Start; 625if (This.Selection.IsEmpty) 634TextRangeEditLists.ConvertListItemsToParagraphs((TextRange)This.Selection); 637(IsAtListItemChildStart(position, false /* emptyChildOnly */) || IsAtIndentedParagraphOrBlockUIContainerStart(This.Selection.Start))) 650((TextSelection)This.Selection).ClearSpringloadFormatting(); 657((TextSelection)This.Selection).ClearSpringloadFormatting(); 699This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 709This.Selection.Select(This.Selection.End, backspacePosition); 716This.Selection.ExtendToNextInsertionPosition(LogicalDirection.Backward); 725((TextSelection)This.Selection).ClearSpringloadFormatting(); 726((TextSelection)This.Selection).SpringloadCurrentFormatting(); 740This.Selection.Text = String.Empty; 741position = This.Selection.Start; 748This.Selection.SetCaretToPosition(position, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 797This.Selection.SetCaretToPosition(deletePosition, directionOfDelete, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/true); 802((TextSelection)This.Selection).ClearSpringloadFormatting(); 924if (This.Selection.IsTableCellRange) 931ITextPointer wordBoundary = This.Selection.End.CreatePointer(); 937if (This.Selection.IsEmpty) 942if (TextRangeEditTables.IsTableStructureCrossed(This.Selection.Start, wordBoundary)) 947ITextRange textRange = new TextRange(This.Selection.Start, wordBoundary); 957using (This.Selection.DeclareChangeBlock()) 962((TextSelection)This.Selection).ClearSpringloadFormatting(); 965This.Selection.Select(textRange.Start, textRange.End); 968This.Selection.Text = String.Empty; 982if (This.Selection.IsTableCellRange) 990ITextPointer wordBoundary = This.Selection.Start.CreatePointer(); 996if (This.Selection.IsEmpty) 1002if (TextRangeEditTables.IsTableStructureCrossed(wordBoundary, This.Selection.Start)) 1009ITextRange textRange = new TextRange(wordBoundary, This.Selection.End); 1019using (This.Selection.DeclareChangeBlock()) 1024((TextSelection)This.Selection).ClearSpringloadFormatting(); 1025This.Selection.Select(textRange.Start, textRange.End); 1026((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1030This.Selection.Select(textRange.Start, textRange.End); 1034This.Selection.Text = String.Empty; 1058if (This.Selection.IsTableCellRange || !This.AcceptsReturn) 1077if (This.Selection.IsTableCellRange || !This.AcceptsReturn || !This.UiScope.IsKeyboardFocused) 1085using (This.Selection.DeclareChangeBlock()) 1092if (This.AcceptsRichContent && This.Selection.Start is TextPointer) 1107This.Selection.SetCaretToPosition(This.Selection.End, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1121((TextSelection)This.Selection).SpringloadCurrentFormatting(); 1123if (!This.Selection.IsEmpty) 1126This.Selection.Text = String.Empty; 1136TextPointer newEnd = ((TextSelection)This.Selection).End; 1157This.Selection.Select(newEnd, newEnd); 1170string filteredText = This._FilterText(Environment.NewLine, This.Selection); 1174This.Selection.Text = Environment.NewLine; 1189Invariant.Assert(This.Selection.Start is TextPointer); 1190TextPointer position = (TextPointer)This.Selection.Start; 1197TextRange range = ((TextSelection)This.Selection).InsertRows(+1); 1198This.Selection.SetCaretToPosition(range.Start, LogicalDirection.Forward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1200else if (This.Selection.IsEmpty && 1221This.Selection.Select(newEnd, newEnd); 1244using (This.Selection.DeclareChangeBlock()) 1248if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1251((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.LeftToRight, /*applyToParagraphs*/true); 1264if (This.AcceptsRichContent && (This.Selection is TextSelection)) 1267((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.RightToLeft, /*applyToParagraphs*/true); 1276((TextSelection)This.Selection).UpdateCaretState(CaretScrollMethod.Simple); 1376if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1408if (This.AcceptsRichContent && (!This.Selection.IsEmpty || TextPointerBase.IsAtParagraphOrBlockUIContainerStart(This.Selection.Start)) && 1430if (This.Selection.IsTableCellRange) 1434This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false); 1438if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.End)) 1442TableRow row = ((TextPointer)This.Selection.End).Parent as TableRow; 1464This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1470TextElement parent = ((TextPointer)This.Selection.Start).Parent as TextElement; 1516This.Selection.Select(cell.ContentStart, cell.ContentEnd); 1563string filteredText = This._FilterText(textData, This.Selection); 1575using (This.Selection.DeclareChangeBlock()) 1577This.Selection.ApplyTypingHeuristics(This.AllowOvertype && This._OvertypeMode && filteredText != "\t"); 1582ITextPointer caretPosition = This.Selection.End.CreatePointer(LogicalDirection.Backward); 1585This.Selection.SetCaretToPosition(caretPosition, LogicalDirection.Backward, /*allowStopAtLineEnd:*/true, /*allowStopNearSpace:*/true); 1841This._typingUndoUnit = new TextParentUndoUnit(This.Selection);
src\Framework\System\windows\Documents\TextSelection.cs (2)
777RefreshCaret(_textEditor, _textEditor.Selection); 1648focusedTextSelection = textEditor.Selection;
src\Framework\System\Windows\Documents\TextStore.cs (4)
2224textEditor.Selection.BeginChangeNoUndo(); 2242_ignoreNextSelectionChange = textEditor.Selection._IsChanged; 2248textEditor.Selection.EndChange(false /* disableScroll */, true /* skipEvents */); 3963get { return this.TextEditor.Selection; }