Search Results for

    Show / Hide Table of Contents

    Class FileBrowser.FileTypeHandler

    Helper class encapsulating all data and functionality needed to handle one file type.

    Inheritance
    object
    FileBrowser.FileTypeHandler
    Namespace: AS2
    Assembly: .dll
    Syntax
    protected class FileBrowser.FileTypeHandler

    Constructors

    | Edit this page View Source

    FileTypeHandler(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 Source

    defaultName

    The initial of the saved file if no other name is specified.

    Declaration
    public string defaultName
    Field Value
    Type Description
    string
    | Edit this page View Source

    defaultTitleLoad

    The title of the load dialog if no other title is specified.

    Declaration
    public string defaultTitleLoad
    Field Value
    Type Description
    string
    | Edit this page View Source

    defaultTitleSave

    The title of the save dialog if no other title is specified.

    Declaration
    public string defaultTitleSave
    Field Value
    Type Description
    string
    | Edit this page View Source

    fileExt

    The file extension(s) used for the file type.

    Declaration
    public string fileExt
    Field Value
    Type Description
    string
    | Edit this page View Source

    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 Source

    LoadFile(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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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.

    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX