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

Base for formatting commands that toggle a style and report changes to its current on/off state.

Definition

Namespace:Telerik.WinForms.Documents.RichTextBoxCommands

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public abstract class ToggleCommandBase : RichTextBoxCommandBase, ICommand

Inheritance: objectRichTextBoxCommandBaseToggleCommandBase

Derived Classes: ToggleBoldCommandToggleBulletsCommandToggleCommentsCommandToggleDifferentFirstPageHeaderFooterCommandToggleDifferentOddAndEvenPagesHeaderFooterCommandToggleDocumentProtectionCommandToggleFormattingSymbolsCommandToggleHeaderFooterLinkToPreviousCommandToggleItalicCommandToggleMergeFieldsHighlightCommandToggleNumberedCommandToggleSpellCheckingCommandToggleStrikethroughCommandToggleSubscriptCommandToggleSuperscriptCommandToggleTableLookCommandBaseToggleTableRowRepeatOnEveryPageCommandToggleTrackChangesCommandToggleUnderlineCommand...

Implements: ICommand

Inherited Members RichTextBoxCommandBase.CanExecute(object)RichTextBoxCommandBase.CanExecuteOverride(object)RichTextBoxCommandBase.Execute()RichTextBoxCommandBase.Execute(object)RichTextBoxCommandBase.GetSelectedInlineOrSelectCurrent()RichTextBoxCommandBase.Execute(object, bool)RichTextBoxCommandBase.ExecuteOverride(object)RichTextBoxCommandBase.UpdateSectionStyle()RichTextBoxCommandBase.GetCurrentParagraphStyle()RichTextBoxCommandBase.GetCurrentSpanStyle()RichTextBoxCommandBase.GetCurrentSectionStyle()RichTextBoxCommandBase.OnCanExecuteChanged()RichTextBoxCommandBase.AssociatedRichTextBoxRichTextBoxCommandBase.CanExecuteInReadOnlyModeRichTextBoxCommandBase.CanExecuteInReadOnlyRangeRichTextBoxCommandBase.IsDeletingCommandRichTextBoxCommandBase.CanExecuteBehaviorInProtectedDocumentRichTextBoxCommandBase.ShouldFocusCaretAfterExecuteRichTextBoxCommandBase.SupportedTargetsRichTextBoxCommandBase.EnabledRichTextBoxCommandBase.CanExecuteChanged...

Constructors

Initializes the toggle command for the specified editor.

C#
public ToggleCommandBase(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The rich text box whose formatting the command toggles.

Methods

Gets whether the formatting controlled by the derived command is active for the current span.

C#
protected abstract bool GetToggleState()
Returns:

bool

true when the formatting is active; otherwise, false.

Raises the ToggleStateChanged event.

C#
protected virtual void OnToggleStateChanged(StylePropertyChangedEventArgs<bool> e)
Parameters:eStylePropertyChangedEventArgs<bool>

The old and new toggle-state values.

Compares the current toggle state with the cached state and raises ToggleStateChanged when they differ. The first event may report the cache's initial false value as its old value.

C#
protected override void UpdateSpanStyle()

Overrides: RichTextBoxCommandBase.UpdateSpanStyle()

Events

Occurs when the command observes a different toggle state for the current span. The first event may report the cache's initial false value as its old value.

C#
public event EventHandler<StylePropertyChangedEventArgs<bool>> ToggleStateChanged