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