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

Saves the editor's current document; WinForms builds can reuse a stored destination string, while other builds show the save dialog for each execution.

Definition

Constructors

Initializes the command with an existing destination path.

C#
public SaveCommand(RadRichTextBox editor, string fileName)
Parameters:editorRadRichTextBox

The rich text box whose document is saved.

fileNamestring

The destination path used by this command.

Initializes the command without a destination path, so execution can show the save dialog.

C#
public SaveCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The rich text box whose document is saved.

Properties

Gets Always because saving does not edit the document.

C#
protected override CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

Overrides: RichTextBoxCommandBase.CanExecuteBehaviorInProtectedDocument

Gets a value indicating that saving is allowed when the editor is in read-only mode.

C#
protected override bool CanExecuteInReadOnlyMode { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyMode

Gets a value indicating that saving is allowed in read-only ranges.

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Gets the destination string. A save-dialog selection stores only the selected file name, so later saves resolve it relative to the process's current directory.

C#
public string FileName { get; }

Methods

Saves to a stored file name when available in WinForms builds; otherwise, displays the save dialog to choose a destination.

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

An optional file-type filter used when the save dialog is displayed.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)