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

Applies paragraph alignment and swaps left/right alignment for right-to-left paragraphs.

Definition

Constructors

Initializes the command for the specified editor.

C#
public ChangeTextAlignmentCommand(RadRichTextBox radRichTextBox)
Parameters:radRichTextBoxRadRichTextBox

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.

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

A defined RadTextAlignment value or a string parseable as one.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)

Creates event data from the cached alignment and the current paragraph alignment normalized for flow direction.

C#
public StylePropertyChangedEventArgs<RadTextAlignment?> GetEventArgs()
Returns:

StylePropertyChangedEventArgs<RadTextAlignment?>

The cached and current alignment values.

Raises the TextAlignmentChanged event.

C#
protected virtual void OnTextAlignmentChanged(StylePropertyChangedEventArgs<RadTextAlignment?> e)
Parameters:eStylePropertyChangedEventArgs<RadTextAlignment?>

The cached and newly observed alignment values.

Attempts to convert a command parameter to a paragraph alignment.

C#
public static bool TryConvertCommandParameter(object commandParameter, out RadTextAlignment textAlignment)
Parameters:commandParameterobject

A defined RadTextAlignment value or a string accepted by the enum parser.

textAlignmentRadTextAlignment

Receives the parsed alignment, or the enum's default value when conversion fails.

Returns:

bool

true when the parameter is converted; otherwise, false.

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.

C#
protected override void UpdateSpanStyle()

Overrides: RichTextBoxCommandBase.UpdateSpanStyle()

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.

C#
public event EventHandler<StylePropertyChangedEventArgs<RadTextAlignment?>> TextAlignmentChanged