FileDialog
Wisej.Web.FileDialog
Namespace: Wisej.Web
Assembly: Wisej.Framework (2.5.0.0)
Displays a dialog box from which the user can select a file.
This class is abstract. The current implementations in Wisej are OpenFileDialog and SaveFileDialog. You can override this class or OpenFileDialog and SaveFileDialog to add your own custom behavior and localization. You can:
Override PromptFileNotFound. It's called when the specified file doesn't exist and the property CheckFileExists is true.
Override CreateUI to create your custom Form when the method ShowDialog is called.
Set the DialogTemplate to a Form class that has a constructor that accepts FileDialog as the single argument to change the User Interface (UI) of the file dialog.
Override OnFileOk to provide your custom implementation of the actions to execute when the user presses the OK button.
You must add at least one FileSystemProvider to the Roots collection before showing the dialog.
Constructors
FileDialog()
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Initializes a new instance of FileDialog.
FileDialog(roots)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Initializes a new instance of FileDialog using the initial roots .
Name | Type | Description |
---|---|---|
roots | Initial file systems to load in the FolderBrowserDialog. |
FileDialog(container)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Initializes a new instance of the FileDialog extender with a specified container.
Name | Type | Description |
---|---|---|
container | An IContainer that represents the container of the FileDialog component. |
Properties
AddExtension
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Boolean: Returns or sets whether the dialog box automatically adds an extension to a file name if the user omits the extension.
CheckFileExists
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Boolean: Returns or sets whether the dialog box displays a warning if the user specifies a file name that does not exist.
DefaultExtension
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
String: Returns or sets the default file name extension.
FileName
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
String: Returns or sets a string containing the file name selected in the file dialog box.
FileNames
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
String[]: Returns the file names of all selected files in the dialog box.
FileSystem
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
IFileSystemProvider: Returns the IFileSystemProvider that contains the selected FileName.
Filter
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
String: Returns or sets the current file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box.
FilterIndex
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Int32: Returns or sets the index of the filter currently selected in the file dialog box.
InitialDirectory
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
String: Returns or sets the initial directory displayed by the file dialog box.
Roots
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
FileDialogRootCollection: List of root IFileSystemProvider file systems displayed by the FileDialog.
The Roots collection and the IFileSystemProvider implementations allow the application to use arbitrary names mapped to a specific path. For example, the app may add a root object named "Documents" to "c:\users[logged-user-id]\files\documents". Each user will see "Documents" as the root, but will also see only the files in the [logged-user-id] directory.
ShowHelp
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Boolean: Returns or sets whether the Help button is displayed in the file dialog box.
Title
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
String: Returns or sets the file dialog box title.
Methods
GetRoot(path)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Returns the IFileSystemProvider that contains the specified path .
Returns: IFileSystemProvider. The IFileSystemProvider that contains the specified path or null if not found.
MapPath(filePath)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Maps the virtual path to the corresponding physical path on the specific IFileSystemProvider implementation.
Parameter | Type | Description |
---|---|---|
filePath | Virtual path to map to the corresponding physical path. |
Returns: String. The physical path for the IFileSystemProvider implementation.
ProcessFileNames(fileNames)
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Receives the file names selected by the user and validates them according to the properties set in the FileDialog instance.
Parameter | Type | Description |
---|---|---|
fileNames | Array containing the selected file paths. |
Returns: Boolean. True if the files have been validated and the dialog can close; otherwise false to keep the dialog open.
Reset()
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
Resets all properties to their default values.
Events
FileOk
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
CancelEventHandler Fired when the user clicks on the Open or Save button on a file dialog box.
LoadPath
![](https://docs.wisej.com/~gitbook/image?url=https%3A%2F%2F314832588-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MTHCfAYyBPycFG90wsw-4198400543%252Fuploads%252Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%252Finstance.png%3Falt%3Dmedia%26token%3D060b281d-9363-48a1-a0f9-788ad1831e96&width=300&dpr=4&quality=100&sign=2218e05e&sv=1)
FileDialogLoadPathEventHandler Fired when the file dialog is loading a file or folder.
Inherited By
Name | Description |
---|---|
Prompts the user to open a file from the server. | |
Prompts the user to select a location for saving a file on the server. |
Last updated