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

Toggles document protection through the protect or unprotect dialog; documents accepting an empty password can be unprotected directly.

Definition

Constructors

Creates the command and tracks document-protection changes to update its toggle state.

C#
public ToggleDocumentProtectionCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The editor whose document protection is toggled.

Properties

Allows the command to execute while the document is protected.

C#
protected override CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

Overrides: RichTextBoxCommandBase.CanExecuteBehaviorInProtectedDocument

Allows command availability checks in read-only ranges.

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Methods

Shows the protection dialog, or removes protection directly when an empty password is sufficient.

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

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)

Gets whether document protection is currently enforced.

C#
protected override bool GetToggleState()
Returns:

bool

true when protection is enforced; otherwise, false.

Overrides: ToggleCommandBase.GetToggleState()

Does not refresh protection state when the current span style changes.

C#
protected override void UpdateSpanStyle()

Overrides: ToggleCommandBase.UpdateSpanStyle()