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