Class
KeyboardSelectionHandler

This class handles the selection from the keyboard.

Definition

Namespace:Telerik.Windows.Documents.Selection

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class KeyboardSelectionHandler

Inheritance: objectKeyboardSelectionHandler

Constructors

KeyboardSelectionHandler(RadDocument)

Initializes a new instance of the KeyboardSelectionHandler class.

Declaration

cs-api-definition
public KeyboardSelectionHandler(RadDocument document)

Parameters

document

RadDocument

The current document.

Properties

Document

Gets the current document.

Declaration

cs-api-definition
protected RadDocument Document { get; }

Property Value

RadDocument

LastCaretPosition

Gets the caret position when starting the selection.

Declaration

cs-api-definition
protected DocumentPosition LastCaretPosition { get; }

Property Value

DocumentPosition

Methods

ExpandDownLeft(DocumentPosition)

Expands the selection downwards and to the left from the specified document position.

Declaration

cs-api-definition
public virtual DocumentPosition ExpandDownLeft(DocumentPosition currentPosition)

Parameters

currentPosition

DocumentPosition

The starting position from which to expand the selection.

Returns

DocumentPosition

Returns the new selection position after expanding.

ExpandTopRight(DocumentPosition)

Expands the selection to the top right from the specified document position.

Declaration

cs-api-definition
public virtual DocumentPosition ExpandTopRight(DocumentPosition currentPosition)

Parameters

currentPosition

DocumentPosition

The starting document position from which to expand the selection.

Returns

DocumentPosition

Returns a boolean indicating whether the selection was successfully expanded.

UpdateSelection(MoveCaretDirections)

This method updates the selected range when the caret is moved by pressing shift and the arrow keys.

Declaration

cs-api-definition
public virtual void UpdateSelection(MoveCaretDirections direction = MoveCaretDirections.Unknown)

Parameters

direction

MoveCaretDirections

The current movement direction of the caret.