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