Class RichTextBoxCommandBase
Represents the base class for commands that can be executed within a RichTextBox.
Inheritance
Namespace: Telerik.Windows.Documents.RichTextBoxCommands
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public abstract class RichTextBoxCommandBase : Object, ICommand
Constructors
RichTextBoxCommandBase(RadRichTextBox)
Properties
AssociatedRichTextBox
Gets the associated rich text box.
Declaration
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
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
protected virtual bool CanExecuteInReadOnlyMode { get; }
Property Value
System.Boolean
|
CanExecuteInReadOnlyRange
Gets a value indicating whether this command can be executed when editing context is read-only. The default implementation returns false.
Declaration
protected virtual bool CanExecuteInReadOnlyRange { get; }
Property Value
System.Boolean
|
Enabled
Gets or sets a value indicating whether the command is enabled.
Declaration
public bool Enabled { get; set; }
Property Value
System.Boolean
|
IsDeletingCommand
Declaration
protected virtual bool IsDeletingCommand { get; }
Property Value
System.Boolean
|
ShouldFocusCaretAfterExecute
Declaration
protected virtual bool ShouldFocusCaretAfterExecute { get; }
Property Value
System.Boolean
|
SupportedTargets
Gets the supported CommandTargets for the command.
Declaration
protected virtual CommandTargets SupportedTargets { get; }
Property Value
CommandTargets
|
Methods
CanExecute(Object)
Determines whether the command can be executed with the specified parameter.
Declaration
public bool CanExecute(object parameter)
Parameters
System.Object
parameter
The parameter to evaluate for the command execution. |
Returns
System.Boolean
True if the command can be executed; otherwise, false. |
CanExecuteOverride(Object)
Performs a check whether the command can be executed specific to the command.
Declaration
protected virtual bool CanExecuteOverride(object parameter)
Parameters
System.Object
parameter
The command parameter. |
Returns
System.Boolean
|
Execute()
Executes the command, performing the associated action on the RichTextBox.
Declaration
public void Execute()
Execute(Object)
Executes the command with the specified parameter.
Declaration
public void Execute(object parameter)
Parameters
System.Object
parameter
The parameter to execute the command with. |
Execute(Object, Boolean)
Executes the command with the specified parameter and an option to suppress events.
Declaration
public void Execute(object parameter, bool focusCaret)
Parameters
System.Object
parameter
The parameter to be used during the command execution. |
System.Boolean
focusCaret
A boolean value indicating whether to suppress events during execution. |
ExecuteOverride(Object)
Performs the execute action specific to the command.
Declaration
protected abstract void ExecuteOverride(object parameter)
Parameters
System.Object
parameter
The command parameter. |
GetCurrentParagraphStyle()
GetCurrentSectionStyle()
GetCurrentSpanStyle()
GetSelectedInlineOrSelectCurrent()
Retrieves the currently selected inline element in the RichTextBox. If there is no selection, it selects the current inline element.
Declaration
public Inline GetSelectedInlineOrSelectCurrent()
Returns
Inline
The selected inline element, or the current inline element if no selection is made. |
OnCanExecuteChanged()
Declaration
protected void OnCanExecuteChanged()
UpdateSectionStyle()
Declaration
protected virtual void UpdateSectionStyle()
UpdateSpanStyle()
Declaration
protected virtual void UpdateSpanStyle()
Events
CanExecuteChanged
Declaration
public event EventHandler CanExecuteChanged
Event Type
System.EventHandler
|