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