This class handles the mouse selection in RadRichTextBox.
Definition
Namespace:Telerik.Windows.Documents.Selection
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class MouseSelectionHandler
Inheritance: objectMouseSelectionHandler
Constructors
public MouseSelectionHandler(RadDocument document, IDocumentEditorPresenter presenter)
Fields
This maximum time between click that is considered double click.
public static double DoubleClickTime
The number of pixels that is acceptable for the mouse to move when doble clicking.
public static int MouseDoubleClickThreshold
The number of pixels that is considered a drag operation.
public static int MouseDragThreshold
Properties
Gets the drop position for the mouse selection handler.
public DocumentPosition DropPosition { get; }
Gets a value indicating whether the current mouse selection is a click selection.
public bool IsClickSelecting { get; }
Gets a value indicating whether the mouse is currently dragging a selection.
public bool IsDragging { get; }
Determines whether the selection is currently being dragged.
public bool IsMoveSelectionDragging { get; }
Gets a value indicating whether the mouse selection handler is currently tracking mouse movements.
public bool IsTracking { get; }
Methods
Cancels the current mouse selection, resetting any selected elements to their unselected state.
public bool CancelSelection()
Returns a boolean indicating whether the selection was successfully canceled.
protected virtual void OnSelectionDragged(SelectionDragEventArgs e)
Registers the mouse down event for a document, allowing for custom selection behavior.
public virtual void RegisterDocumentMouseDown(bool ctrlPressed, bool shiftPressed, Point position, UIElement originalSource = null, SourceType source = SourceType.Mouse)
Indicates if the Control key is pressed during the mouse down event.
shiftPressedboolIndicates if the Shift key is pressed during the mouse down event.
positionPointThe position of the mouse cursor when the mouse down event occurred.
originalSourceUIElementThe UI element that is the target of the mouse down event.
sourceSourceTypeThe source type of the selection event.
Registers a mouse move event for the document selection handler.
public virtual void RegisterDocumentMouseMove(Point position, SourceType source = SourceType.Mouse)
The point in the document where the mouse move event occurs.
sourceSourceTypeThe source type that indicates where the mouse move event originated from.
Registers the mouse right button down event for the specified UI element in the document selection.
public virtual void RegisterDocumentMouseRightButtonDown(UIElement originalSource, SourceType source = SourceType.Mouse)
The UI element to which the mouse right button down event is registered.
sourceSourceTypeThe source type indicating the origin of the selection action.
Registers a mouse up event handler for the document selection.
public virtual void RegisterDocumentMouseUp(SourceType source = SourceType.Mouse, Point? position = null)
The type of source that triggered the mouse up event.
positionPoint?An optional point representing the location of the mouse up event.
Events
public event EventHandler<SelectionDragEventArgs> SelectionDragged