Class FileBrowser
Utility for opening file dialogs used to save and load files
of several types. Uses the StandaloneFileBrowser
plugin.
This class saves the last used directory separately for each file type.
Inheritance
Namespace: AS2
Assembly: .dll
Syntax
public static class FileBrowser
Fields
| Edit this page View SourceinitHandler
Declaration
private static FileBrowser.FileTypeHandler initHandler
Field Value
Type | Description |
---|---|
FileBrowser.FileTypeHandler |
pngHandler
Declaration
private static FileBrowser.FileTypeHandler pngHandler
Field Value
Type | Description |
---|---|
FileBrowser.FileTypeHandler |
simHandler
Declaration
private static FileBrowser.FileTypeHandler simHandler
Field Value
Type | Description |
---|---|
FileBrowser.FileTypeHandler |
textHandler
Declaration
private static FileBrowser.FileTypeHandler textHandler
Field Value
Type | Description |
---|---|
FileBrowser.FileTypeHandler |
Methods
| Edit this page View SourceLoadInitFile(string, string)
Opens a save file dialog for initialization state files.
Declaration
public static string LoadInitFile(string title = "Load Initialization State", string directory = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | The title of the dialog window. |
string | directory | The initial directory. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
LoadSimFile(string, string)
Opens a load file dialog for simulation state files.
Declaration
public static string LoadSimFile(string title = "Load Simulation State", string directory = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | The title of the dialog window. |
string | directory | The initial directory. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
SaveInitFile(string, string, string)
Opens a save file dialog for initialization state files.
Declaration
public static string SaveInitFile(string title = "Save Initialization State", string defaultName = "initState", 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. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
SavePNGFile(string, string, string)
Opens a save file dialog for PNG files.
Declaration
public static string SavePNGFile(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. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
SaveSimFile(string, string, string)
Opens a save file dialog for simulation state files.
Declaration
public static string SaveSimFile(string title = "Save Simulation State", string defaultName = "algorithm", 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. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |
SaveTextFile(string, string, string)
Opens a save file dialog for text files.
Declaration
public static string SaveTextFile(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. |
Returns
Type | Description |
---|---|
string | The path to the selected file. Will be empty if no file was selected. |