// Token: 0x0600387D RID: 14461 RVA: 0x000FD1BC File Offset: 0x000FB3BC internal static void SetCaretPositionOnMouseEvent(TextEditor This, Point mouseDownPoint, MouseButton changedButton, int clickCount) { ITextPointer textPositionFromPoint = This.TextView.GetTextPositionFromPoint(mouseDownPoint, true); if (textPositionFromPoint == null) { TextEditorMouse.MoveFocusToUiScope(This); return; } TextEditorSelection._ClearSuggestedX(This); TextEditorTyping._BreakTypingSequence(This); if (This.Selection is TextSelection) { ((TextSelection)This.Selection).ClearSpringloadFormatting(); } This._forceWordSelection = false; This._forceParagraphSelection = false; if (changedButton == MouseButton.Right || clickCount == 1) { if (changedButton != MouseButton.Left || !This._dragDropProcess.SourceOnMouseLeftButtonDown(mouseDownPoint)) { This.Selection.SetSelectionByMouse(textPositionFromPoint, mouseDownPoint); return; } } else { if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.None && This.Selection.IsEmpty) { This._forceWordSelection = true; This._forceParagraphSelection = false; This.Selection.SelectWord(textPositionFromPoint); return; } if (clickCount == 3 && (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.None && This.AcceptsRichContent) { This._forceParagraphSelection = true; This._forceWordSelection = false; This.Selection.SelectParagraph(textPositionFromPoint); } } }
// Token: 0x0600387F RID: 14463 RVA: 0x000FD304 File Offset: 0x000FB504 internal static void OnMouseDown(object sender, MouseButtonEventArgs e) { TextEditor textEditor = TextEditor._GetTextEditor(sender); if (textEditor == null) { return; } textEditor.CloseToolTip(); if (!textEditor._IsEnabled) { return; } if (!textEditor.UiScope.Focusable) { return; } if (e.ButtonState == MouseButtonState.Released) { return; } e.Handled = true; TextEditorMouse.MoveFocusToUiScope(textEditor); if (textEditor.UiScope != Keyboard.FocusedElement) { return; } if (e.ChangedButton != MouseButton.Left) { return; } if (textEditor.TextView == null) { return; } textEditor.CompleteComposition(); if (!textEditor.TextView.IsValid) { textEditor.TextView.RenderScope.UpdateLayout(); if (textEditor.TextView == null || !textEditor.TextView.IsValid) { return; } } if (!TextEditorMouse.IsPointWithinInteractiveArea(textEditor, e.GetPosition(textEditor.UiScope))) { return; } textEditor.TextView.ThrottleBackgroundTasksForUserInput(); Point position = e.GetPosition(textEditor.TextView.RenderScope); if (TextEditor.IsTableEditingEnabled && TextRangeEditTables.TableBorderHitTest(textEditor.TextView, position)) { textEditor._tableColResizeInfo = TextRangeEditTables.StartColumnResize(textEditor.TextView, position); Invariant.Assert(textEditor._tableColResizeInfo != null); textEditor._mouseCapturingInProgress = true; try { textEditor.UiScope.CaptureMouse(); return; } finally { textEditor._mouseCapturingInProgress = false; } } textEditor.Selection.BeginChange(); try { TextEditorMouse.SetCaretPositionOnMouseEvent(textEditor, position, e.ChangedButton, e.ClickCount); textEditor._mouseCapturingInProgress = true; textEditor.UiScope.CaptureMouse(); } finally { textEditor._mouseCapturingInProgress = false; textEditor.Selection.EndChange(); } }