Applies paragraph alignment and swaps left/right alignment for right-to-left paragraphs.
Definition
Namespace:Telerik.WinForms.Documents.RichTextBoxCommands
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class ChangeTextAlignmentCommand : RichTextBoxCommandBase, ICommand
Inheritance: objectRichTextBoxCommandBaseChangeTextAlignmentCommand
Implements:
Inherited Members
Constructors
Initializes the command for the specified editor.
public ChangeTextAlignmentCommand(RadRichTextBox radRichTextBox)
The rich text box whose paragraph alignment this command changes.
Methods
Applies a supported alignment value, normalizing left/right alignment for the paragraph's flow direction.
protected override void ExecuteOverride(object parameter)
A defined RadTextAlignment value or a string parseable as one.
Overrides:
Creates event data from the cached alignment and the current paragraph alignment normalized for flow direction.
public StylePropertyChangedEventArgs<RadTextAlignment?> GetEventArgs()
StylePropertyChangedEventArgs<RadTextAlignment?>
The cached and current alignment values.
Raises the TextAlignmentChanged event.
protected virtual void OnTextAlignmentChanged(StylePropertyChangedEventArgs<RadTextAlignment?> e)
The cached and newly observed alignment values.
Attempts to convert a command parameter to a paragraph alignment.
public static bool TryConvertCommandParameter(object commandParameter, out RadTextAlignment textAlignment)
A defined RadTextAlignment value or a string accepted by the enum parser.
textAlignmentRadTextAlignmentReceives the parsed alignment, or the enum's default value when conversion fails.
Returns:Reads the current paragraph alignment and raises an event when the cached value is null or differs. An unset default remains null, so repeated style updates can raise repeated events.
protected override void UpdateSpanStyle()
Overrides:
Events
Occurs when the command reads the current paragraph alignment and its cached value is null or differs. An unset default remains null, so repeated style updates can raise repeated events.
public event EventHandler<StylePropertyChangedEventArgs<RadTextAlignment?>> TextAlignmentChanged