OpenFileDialog
FileDialogCommonDialogWidgetDialog to select a file (or files) from the file system to open in the application
Properties
CheckFileExists
Gets or sets a value indicating whether this FileDialog checks if the file exists before the user can close the dialog.
Value:
true to check if the file exists; otherwise, false.Remarks: This can sometimes be useful to get the platform-specific object. Some handlers may not have any backing object for its functionality, so this may be null. It is more preferred to use the Widget.Handler and cast that to the platform-specific handler class which can give you additional methods and helpers to do common tasks. For example, the Application object's handler for OS X has a AddFullScreenMenuItem property to specify if you want full screen support in your app.
inherited fromFileDialog
Remarks: This should always match an instance of a filter in the FileDialog.Filters collection, otherwise the current filter will be set to null.
Value: The current filter.
See Also: FileDialog.Filters
inherited fromFileDialog
Value: The index of the current filter, or -1 if none is selected.
Directory
Gets or sets the directory the file dialog will show files.
Remarks: You can use EtoEnvironment.GetFolderPath(EtoSpecialFolder) to set the initial value of the directory, though the user should be able to change the folder and keep it
Value: The directory.
FileName
Gets or sets the full name and path of the file that is selected
Value: The name of the file.
Filenames
#Gets the full path of the files selected by the user, when MultiSelect is true.
Remarks: This will return a single file name if MultiSelect is false.
Value: The full path of the files selected, or a single file if MultiSelect is false.
Filters
Gets the collection of available file filters the user can select from.
Remarks: Add entries to this collection to set the filters the user can select when the file dialog is shown. Some platforms may either disable (OS X) or hide (GTK/WinForms/WPF) files that do not match the currently selected filter.
Value: The filters the user can select.
IsDisposed
Gets or sets a value indicating whether this Widget has been disposed.
Remarks: When the widget is disposed, it can no longer be used.
Value:
true if this instance has been disposed; otherwise, false.MultiSelect
#Gets or sets a value indicating whether the user can select multiple files, or a single file.
Value:
true if the user can select multiple files; otherwise, false.NativeHandle
public nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
Value: The native handle.
inherited fromWidget
Remarks: This gets set to the current Platform.Instance during the construction of the object
Remarks: Styles allow you to attach custom platform-specific logic to a widget. In your platform-specific assembly, use Add{H} to add the style logic with the same id.
Example:
// in your UI
var control = new Button { Style = "mystyle" };
// in your platform assembly
using Eto.Mac.Forms.Controls;
Styles.AddHandler<ButtonHandler>("mystyle", handler => {
// this is where you can use handler.Control to set properties, handle events, etc.
handler.Control.BezelStyle = NSBezelStyle.SmallSquare;
});Methods
Dispose
public void Dispose()
Disposes of this widget, supressing the finalizer
Parameters:
| disposing (bool) | True if the caller called Widget.Dispose() manually, false if being called from a finalizer |
GetCallback
Gets an instance of an object used to perform callbacks to the widget from handler implementations
Remarks: The callback should implement the parent class' Widget.ICallback interface so that there only needs to be a single callback for the entire hierarchy. This should return a static instance to avoid having overhead for each instance of your control.
Returns: The callback instance to use for this widget
Initialize
protected void Initialize()
Initializes the widget handler
Remarks: This is typically called from the constructor after all of the logic is completed to construct the object. If your handler interface has the AutoInitializeAttribute set to false, then you are responsible for calling this method in your constructor after calling the creation method on your custom handler.
inherited fromWidget
ShowDialog
Shows the dialog with the specified parent, blocking until a result is returned.
Parameters:
| parent (Control) | Parent control |
Returns: The dialog result.
ShowDialog
Shows the dialog with the specified parent window, blocking until a result is returned.
Parameters:
| parent (Window) | Parent window. |
Returns: The dialog result.
ToString
Gets a string that represents the current object with its ID if specified.
Returns: A string value indicating the type and ID (if specified) of this widget.
Overrides: Object.ToString
Events
inherited fromWidget