New to Telerik UI for WPFStart a free 30-day trial

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:

C#
public abstract class RichTextBoxCommandBase : ICommand

Inheritance: objectRichTextBoxCommandBase

Derived Classes: AcceptAllRevisionsCommandAcceptRevisionCommandAddShapeTextBoxCommandCancelFormatPainterCommandChangeBibliographicStyleCommandChangeColorCommandBaseChangeFontFamilyCommandChangeFontSizeCommandChangeFormatPainterStateCommandChangeIntegratedWatermarkTypeCommandChangeLayoutModeCommandChangeListStyleCommandChangePageMarginsTypeCommandChangePageOrientationCommandChangePaperTypeCommandChangeParagraphFlowDirectionCommandChangeParagraphListLevelCommandChangeSectionColumnsCommandChangeSectionHeaderFooterMarginBaseChangeStyleNameCommandChangeTextAlignmentCommandChangeUnderlineDecorationCommandClearAllFormattingCommandClearFormattingCommandCommentCommandBaseContinueNumberingCommandCopyFormattingCommandDecrementFontSizeCommandDecrementParagraphLeftIndentCommandDeleteCodeBlockCommandDeleteCommandDrawingContextCommandBaseEditFooterCommandEditHeaderCommandEditShapeTextBoxCommandExitHeaderFooterEditModeCommandFieldRangeStartBaseCommandBase<T>GoToNextEndnoteCommandGoToNextFootnoteCommandGoToNextRevisionCommandGoToPreviousEndnoteCommandGoToPreviousFootnoteCommandGoToPreviousRevisionCommandImageContextCommandBaseIncrementFontSizeCommandIncrementParagraphLeftIndentCommandInsertBreakCommandInsertColumnBreakCommandInsertDocumentFragmentCommandInsertEndnoteCommandInsertFieldCommandInsertFootnoteCommandInsertLineBreakCommandInsertLineNumberingCommandInsertNonBreakingSpaceCommandInsertPageBreakCommandInsertPictureCommandInsertSectionBreakCommandInsertStructuredDocumentTagCommandInsertTableCommandInsertTextCommandMailMergeDataSourceContextCommandBaseMergeTableCellsCommandMoveCaretCommandMoveSelectionCommandMultipleUndoCommandNewDocumentCommandOpenContextMenuOnNextSpellingErrorCommandOpenDocumentCommandPasteCommandPasteFormattingCommandPrintCommandPrintPreviewCommandRedoCommandRejectAllRevisionsCommandRejectRevisionCommandRemoveWatermarkCommandRestartNumberingCommandSaveCommandSelectAllCommandSelectionEnabledCommandShapeContextCommandBaseShowAddNewBibliographicReferenceDialogCommandShowChangeEditingPermissionsDialogCommandShowCodeFormattingDialogCommandShowContentControlPropertiesDialogCommandShowDefineNewListStyleDialogCommandShowFindReplaceDialogCommandShowFontPropertiesDialogCommandShowInsertCaptionDialogCommandShowInsertCrossReferenceWindowCommandShowInsertDateTimeDialogCommandShowInsertHyperlinkDialogCommandShowInsertSymbolWindowCommandShowInsertTableDialogCommandShowInsertTableOfContentsDialogCommandShowLineNumberingDialogCommandShowManageBibliographicSourcesDialogCommandShowManageBookmarksDialogCommandShowManageStylesDialogCommandShowNotesDialogCommandShowParagraphPropertiesDialogCommandShowSectionColumnsDialogCommandShowSetNumberingValueDialogCommandShowSpellCheckingDialogCommandShowStyleFormattingPropertiesDialogCommandShowTabStopsPropertiesDialogCommandShowTaskPaneCommandShowWatermarkSettingsDialogCommandSuppressLineNumberingForCurrentParagraphCommandTabBackwardCommandTabForwardCommandTableContextCommandBaseToggleCommandBaseToggleInsertShapeToolCommandUndoCommandUpdateAllFieldsCommand...

Implements: ICommand

Constructors

C#
public RichTextBoxCommandBase(RadRichTextBox editor)
Parameters:editorRadRichTextBox

Properties

Gets the associated rich text box.

C#
public RadRichTextBox AssociatedRichTextBox { get; }
Property Value:

The associated rich text box.

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

C#
protected virtual CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

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

C#
protected virtual bool CanExecuteInReadOnlyMode { get; }
Property Value:

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

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

C#
protected virtual bool CanExecuteInReadOnlyRange { get; }

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

C#
public bool Enabled { get; set; }
C#
protected virtual bool IsDeletingCommand { get; }
C#
protected virtual bool ShouldFocusCaretAfterExecute { get; }

Gets the supported CommandTargets for the command.

C#
protected virtual CommandTargets SupportedTargets { get; }

Methods

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

C#
public bool CanExecute(object parameter)
Parameters:parameterobject

The parameter to evaluate for the command execution.

Returns:

bool

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

Implements: ICommand.CanExecute(object)

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

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

The command parameter.

Returns:

bool

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

C#
public void Execute()

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

C#
public void Execute(object parameter, bool focusCaret)
Parameters:parameterobject

The parameter to be used during the command execution.

focusCaretbool

A boolean value indicating whether to suppress events during execution.

Executes the command with the specified parameter.

C#
public void Execute(object parameter)
Parameters:parameterobject

The parameter to execute the command with.

Implements: ICommand.Execute(object)

Performs the execute action specific to the command.

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

The command parameter.

C#
protected Paragraph GetCurrentParagraphStyle()
Returns:

Paragraph

C#
protected Section GetCurrentSectionStyle()
Returns:

Section

C#
protected Span GetCurrentSpanStyle()
Returns:

Span

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

C#
public Inline GetSelectedInlineOrSelectCurrent()
Returns:

Inline

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

C#
protected void OnCanExecuteChanged()
C#
protected virtual void UpdateSectionStyle()
C#
protected virtual void UpdateSpanStyle()

Events

C#
public event EventHandler CanExecuteChanged

Implements: ICommand.CanExecuteChanged