Class
RichTextBoxCommandBase

Represents the base class for commands that can be executed within a RichTextBox.

Definition

Namespace:Telerik.Windows.Documents.RichTextBoxCommands

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public abstract class RichTextBoxCommandBase : ICommand

Inheritance: objectRichTextBoxCommandBase

Derived Classes: AcceptAllRevisionsCommandAcceptRevisionCommandAddShapeTextBoxCommandCancelFormatPainterCommandChangeBibliographicStyleCommandChangeColorCommandBaseChangeFontFamilyCommandChangeFontSizeCommandChangeFormatPainterStateCommandChangeIntegratedWatermarkTypeCommandChangeLayoutModeCommandChangeListStyleCommandChangePageMarginsTypeCommandChangePageOrientationCommandChangePaperTypeCommandChangeParagraphFlowDirectionCommandChangeParagraphListLevelCommandChangeSectionColumnsCommandChangeSectionHeaderFooterMarginBaseChangeStyleNameCommandChangeTextAlignmentCommandChangeUnderlineDecorationCommandClearAllFormattingCommandClearFormattingCommandCommentCommandBaseContinueNumberingCommandCopyFormattingCommandDecrementFontSizeCommandDecrementParagraphLeftIndentCommandDeleteCodeBlockCommandDeleteCommandDrawingContextCommandBaseEditFooterCommandEditHeaderCommandEditShapeTextBoxCommandExitHeaderFooterEditModeCommandFieldRangeStartBaseCommandBase<T>GoToNextEndnoteCommandGoToNextFootnoteCommandGoToNextRevisionCommandGoToPreviousEndnoteCommandGoToPreviousFootnoteCommandGoToPreviousRevisionCommandImageContextCommandBaseIncrementFontSizeCommandIncrementParagraphLeftIndentCommandInsertBreakCommandInsertColumnBreakCommandInsertDocumentFragmentCommandInsertEndnoteCommandInsertFieldCommandInsertFootnoteCommandInsertLineBreakCommandInsertLineNumberingCommandInsertNonBreakingSpaceCommandInsertPageBreakCommandInsertPictureCommandInsertSectionBreakCommandInsertStructuredDocumentTagCommandInsertTableCommandInsertTextCommandMailMergeDataSourceContextCommandBaseMergeTableCellsCommandMoveCaretCommandMoveSelectionCommandMultipleUndoCommandNewDocumentCommandOpenContextMenuOnNextSpellingErrorCommandOpenDocumentCommandPasteCommandPasteFormattingCommandPrintCommandPrintPreviewCommandRedoCommandRejectAllRevisionsCommandRejectRevisionCommandRemoveWatermarkCommandRestartNumberingCommandSaveCommandSelectAllCommandSelectionEnabledCommandShapeContextCommandBaseShowAddNewBibliographicReferenceDialogCommandShowChangeEditingPermissionsDialogCommandShowCodeFormattingDialogCommandShowContentControlPropertiesDialogCommandShowDefineNewListStyleDialogCommandShowFindReplaceDialogCommandShowFontPropertiesDialogCommandShowInsertCaptionDialogCommandShowInsertCrossReferenceWindowCommandShowInsertDateTimeDialogCommandShowInsertHyperlinkDialogCommandShowInsertSymbolWindowCommandShowInsertTableDialogCommandShowInsertTableOfContentsDialogCommandShowLineNumberingDialogCommandShowManageBibliographicSourcesDialogCommandShowManageBookmarksDialogCommandShowManageStylesDialogCommandShowNotesDialogCommandShowParagraphPropertiesDialogCommandShowSectionColumnsDialogCommandShowSetNumberingValueDialogCommandShowSpellCheckingDialogCommandShowStyleFormattingPropertiesDialogCommandShowTabStopsPropertiesDialogCommandShowTaskPaneCommandShowWatermarkSettingsDialogCommandSuppressLineNumberingForCurrentParagraphCommandTabBackwardCommandTabForwardCommandTableContextCommandBaseToggleCommandBaseToggleInsertShapeToolCommandUndoCommandUpdateAllFieldsCommand

Implements: ICommand

Constructors

RichTextBoxCommandBase(RadRichTextBox)

Declaration

cs-api-definition
public RichTextBoxCommandBase(RadRichTextBox editor)

Parameters

editor

RadRichTextBox

Properties

AssociatedRichTextBox

Gets the associated rich text box.

Declaration

cs-api-definition
public RadRichTextBox AssociatedRichTextBox { get; }

Property Value

RadRichTextBox

The associated rich text box.

CanExecuteBehaviorInProtectedDocument

Gets a value indicating whether the behavior of the command can be executed in a protected document.

Declaration

cs-api-definition
protected virtual CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

Property Value

CanExecuteBehaviorInProtectedDocument

CanExecuteInReadOnlyMode

Gets a value indicating whether this command can be executed when RadRichTextBox is read-only. The default implementation returns false.

Declaration

cs-api-definition
protected virtual bool CanExecuteInReadOnlyMode { get; }

Property Value

bool

true if this command preserves document's content; otherwise, false.

CanExecuteInReadOnlyRange

Gets a value indicating whether this command can be executed when editing context is read-only. The default implementation returns false.

Declaration

cs-api-definition
protected virtual bool CanExecuteInReadOnlyRange { get; }

Property Value

bool

Enabled

Gets or sets a value indicating whether the command is enabled.

Declaration

cs-api-definition
public bool Enabled { get; set; }

Property Value

bool

IsDeletingCommand

Declaration

cs-api-definition
protected virtual bool IsDeletingCommand { get; }

Property Value

bool

ShouldFocusCaretAfterExecute

Declaration

cs-api-definition
protected virtual bool ShouldFocusCaretAfterExecute { get; }

Property Value

bool

SupportedTargets

Gets the supported CommandTargets for the command.

Declaration

cs-api-definition
protected virtual CommandTargets SupportedTargets { get; }

Property Value

CommandTargets

Methods

CanExecute(object)

Determines whether the command can be executed with the specified parameter.

Declaration

cs-api-definition
public bool CanExecute(object parameter)

Parameters

parameter

object

The parameter to evaluate for the command execution.

Returns

bool

True if the command can be executed; otherwise, false.

Implements ICommand.CanExecute(object)

CanExecuteOverride(object)

Performs a check whether the command can be executed specific to the command.

Declaration

cs-api-definition
protected virtual bool CanExecuteOverride(object parameter)

Parameters

parameter

object

The command parameter.

Returns

bool

Execute()

Executes the command, performing the associated action on the RichTextBox.

Declaration

cs-api-definition
public void Execute()

Execute(object)

Executes the command with the specified parameter.

Declaration

cs-api-definition
public void Execute(object parameter)

Parameters

parameter

object

The parameter to execute the command with.

Implements ICommand.Execute(object)

Execute(object, bool)

Executes the command with the specified parameter and an option to suppress events.

Declaration

cs-api-definition
public void Execute(object parameter, bool focusCaret)

Parameters

parameter

object

The parameter to be used during the command execution.

focusCaret

bool

A boolean value indicating whether to suppress events during execution.

ExecuteOverride(object)

Performs the execute action specific to the command.

Declaration

cs-api-definition
protected abstract void ExecuteOverride(object parameter)

Parameters

parameter

object

The command parameter.

GetCurrentParagraphStyle()

Declaration

cs-api-definition
protected Paragraph GetCurrentParagraphStyle()

Returns

Paragraph

GetCurrentSectionStyle()

Declaration

cs-api-definition
protected Section GetCurrentSectionStyle()

Returns

Section

GetCurrentSpanStyle()

Declaration

cs-api-definition
protected Span GetCurrentSpanStyle()

Returns

Span

GetSelectedInlineOrSelectCurrent()

Retrieves the currently selected inline element in the RichTextBox. If there is no selection, it selects the current inline element.

Declaration

cs-api-definition
public Inline GetSelectedInlineOrSelectCurrent()

Returns

Inline

The selected inline element, or the current inline element if no selection is made.

OnCanExecuteChanged()

Declaration

cs-api-definition
protected void OnCanExecuteChanged()

UpdateSectionStyle()

Declaration

cs-api-definition
protected virtual void UpdateSectionStyle()

UpdateSpanStyle()

Declaration

cs-api-definition
protected virtual void UpdateSpanStyle()

Events

CanExecuteChanged

Declaration

cs-api-definition
public event EventHandler CanExecuteChanged

Event Value

EventHandler

Implements ICommand.CanExecuteChanged