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

Opens the code-formatting dialog to insert or edit a code block at the current caret or selection.

Definition

Constructors

Creates a command that opens the code-formatting dialog for the specified editor.

C#
public ShowCodeFormattingDialogCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The editor whose current caret or selection determines the code block context.

Properties

Allows the command's availability to be checked in read-only ranges.

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Treats showing the dialog as a deleting operation for protected-range permission checks.

C#
protected override bool IsDeletingCommand { get; }

Overrides: RichTextBoxCommandBase.IsDeletingCommand

Methods

Enables the command when at most one selection range is active and the current inline is editable or belongs to a code block.

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

Not used; availability depends on the current document selection.

Returns:

bool

true when the current selection context can be used to insert or update a code block.

Overrides: RichTextBoxCommandBase.CanExecuteOverride(object)

Opens the code-formatting dialog.

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

Not used.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)