Class FileBrowser.FileTypeHandler
Helper class encapsulating all data and functionality needed to handle one file type.
Inheritance
Namespace: AS2
Assembly: .dll
Syntax
protected class FileBrowser.FileTypeHandler
Constructors
| Edit this page View SourceFileTypeHandler(string, string, string, string)
Declaration
public FileTypeHandler(string fileExt, string defaultTitleLoad = "", string defaultTitleSave = "", string defaultName = "")
Parameters
Type | Name | Description |
---|---|---|
string | fileExt | |
string | defaultTitleLoad | |
string | defaultTitleSave | |
string | defaultName |
Fields
| Edit this page View SourcedefaultName
The initial of the saved file if no other name is specified.
Declaration
public string defaultName
Field Value
Type | Description |
---|---|
string |
defaultTitleLoad
The title of the load dialog if no other title is specified.
Declaration
public string defaultTitleLoad
Field Value
Type | Description |
---|---|
string |
defaultTitleSave
The title of the save dialog if no other title is specified.
Declaration
public string defaultTitleSave
Field Value
Type | Description |
---|---|
string |
fileExt
The file extension(s) used for the file type.
Declaration
public string fileExt
Field Value
Type | Description |
---|---|
string |
lastDir
The path of the last directory in which a file was saved or loaded.
Declaration
public string lastDir
Field Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceLoadFile(string, string)
Opens a load file dialog and returns the selected file.
Declaration
public string LoadFile(string title = "", string directory = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | The title of the dialog window. |
string | directory | The initial directory in which the dialog starts. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
SaveFile(string, string, string)
Opens a save file dialog and returns the selected file.
Declaration
public string SaveFile(string title = "", string defaultName = "", string directory = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | The title of the dialog window. |
string | defaultName | The initial name of the save file. |
string | directory | The initial directory in which the dialog starts. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
UpdateLastDir(string)
Updates the last used directory using the path returned by the standalone file browser.
Declaration
private void UpdateLastDir(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path returned by the last opened file browser. |