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

Toggles merge-field highlighting in the editor and exposes its current state to toggle controls. The command is available when a mail merge items source is assigned.

Definition

Constructors

Creates a command that toggles merge-field highlighting in the specified editor.

C#
public ToggleMergeFieldsHighlightCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The editor whose merge-field highlighting state is toggled.

Properties

Allows the visual toggle even when document protection is enforced.

C#
protected override CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

Overrides: RichTextBoxCommandBase.CanExecuteBehaviorInProtectedDocument

Allows the visual toggle when the caret or selection is in a read-only range.

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Methods

Returns whether the document has a mail merge items source.

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

Not used; availability is based on the document's mail merge data source.

Returns:

bool

true when the mail merge data source has a non-null items source.

Overrides: RichTextBoxCommandBase.CanExecuteOverride(object)

Reverses the editor's current merge-field highlighting setting.

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

Not used; the command always reverses the current setting.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)

Gets whether merge-field highlighting is currently enabled in the editor.

C#
protected override bool GetToggleState()
Returns:

bool

true when the editor highlights merge fields; otherwise, false.

Overrides: ToggleCommandBase.GetToggleState()

Does not update span formatting because merge-field highlighting is controlled by an editor-level setting.

C#
protected override void UpdateSpanStyle()

Overrides: ToggleCommandBase.UpdateSpanStyle()