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

Wraps a WinForms open-file dialog and exposes its result as a Boolean.

Definition

Namespace:Telerik.WinControls.RichTextEditor.UI

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class OpenFileDialog

Inheritance: objectOpenFileDialog

Constructors

Creates a wrapper around a new WinForms open-file dialog.

C#
public OpenFileDialog()

Wraps the supplied WinForms dialog so its settings and selected file are used by this instance.

C#
public OpenFileDialog(OpenFileDialog dialog)
Parameters:dialogOpenFileDialog

The WinForms dialog to wrap.

Properties

Gets or sets the file-type filter displayed by the wrapped dialog.

C#
public string Filter { get; set; }

Gets the selected file name without its directory path.

C#
public string SafeFileName { get; }

Methods

Opens the selected file and returns its stream. Call after ShowDialog() returns true; the caller owns and should dispose the returned stream.

C#
public Stream OpenFile()
Returns:

Stream

A stream for the selected file.

Shows the wrapped dialog and reports whether the user confirmed a selection.

C#
public bool ShowDialog()
Returns:

bool

true only when the wrapped dialog returns OK.