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

Inserts a comment over the current selection, or over the current word when the selection is empty.

Definition

Constructors

Creates the command and tracks selection changes to update its availability.

C#
public InsertCommentCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The editor whose selection receives a comment.

Properties

Allows insertion from the document body or while a comment is selected.

C#
protected override CommandTargets SupportedTargets { get; }

Overrides: CommentCommandBase.SupportedTargets

Methods

Uses cached selection eligibility; when content layout exists, both range endpoints must have inline boxes and cannot cross table-cell boundaries.

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

bool

true when the current selection passes this command's layout eligibility check; otherwise, false.

Overrides: RichTextBoxCommandBase.CanExecuteOverride(object)

Inserts a new comment, selects it, and enables comment display.

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

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)