New to Telerik UI for WinForms? Start a free 30-day trial

Deletes a code block identified by the command parameter or by the current caret or selection.

Definition

Constructors

Creates a command that deletes code blocks in the specified editor.

C#
public DeleteCodeBlockCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The editor whose code block may be deleted.

Properties

Includes read-only ranges in the command-availability check; read-only context alone does not disable this command.

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Treats code-block deletion as a content-removing operation for protected-range permission checks.

C#
protected override bool IsDeletingCommand { get; }

Overrides: RichTextBoxCommandBase.IsDeletingCommand

Methods

Returns whether the current selection context contains a deletable code block.

C#
protected override bool CanExecuteOverride(object parameter)
Parameters:parameterobject

Not used; availability is determined by the caret and selection.

Returns:

bool

true when at most one selection range is active and its current inline is inside a code block.

Overrides: RichTextBoxCommandBase.CanExecuteOverride(object)

Deletes the supplied code block, or resolves the block containing the caret or selection when no block is supplied.

C#
protected override void ExecuteOverride(object parameter)
Parameters:parameterobject

An optional CodeAnnotationRangeStart identifying the block to delete.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)