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

Opens a document selected by the user and imports it with a registered document format provider.

Definition

Constructors

Initializes the command for the specified editor; in WinForms builds, also creates the default file dialog.

C#
public OpenDocumentCommand(RadRichTextBox editor)
Parameters:editorRadRichTextBox

The rich text box whose document is replaced by the imported document.

Properties

Gets Always because opening a document replaces the current document.

C#
protected override CanExecuteBehaviorInProtectedDocument CanExecuteBehaviorInProtectedDocument { get; }

Overrides: RichTextBoxCommandBase.CanExecuteBehaviorInProtectedDocument

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

C#
protected override bool CanExecuteInReadOnlyRange { get; }

Overrides: RichTextBoxCommandBase.CanExecuteInReadOnlyRange

Gets the result assigned after the file dialog is displayed; initially, the value is None.

C#
public DialogResult DialogResult { get; }

Gets or sets the file dialog used to choose a document to open.

C#
public OpenFileDialog OpenFileDialog { get; set; }
Exceptions: ArgumentNullException

The assigned dialog is null.

Methods

Displays the open dialog, imports the selected file, and assigns the imported document to the editor.

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

An optional file-type filter for the open dialog.

Overrides: RichTextBoxCommandBase.ExecuteOverride(object)