Class FileDialog

Namespace
Forma
Assembly
Forma.dll

Filesystem-selection dialog with navigation, filtering, sorting and list presentation.

public sealed class FileDialog : ConfirmationDialog, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
Inheritance
FileDialog
Implements
Inherited Members

Constructors

FileDialog()

public FileDialog()

Properties

Access

public FileDialogAccess Access { get; set; }

Property Value

FileDialogAccess

CanCreateFolders

public bool CanCreateFolders { get; set; }

Property Value

bool

CanGoBack

Whether GoBack() has an earlier directory to return to, matching Godot's dir_prev enablement.

public bool CanGoBack { get; }

Property Value

bool

CanGoForward

Whether GoForward() has a later directory to redo, matching Godot's dir_next enablement.

public bool CanGoForward { get; }

Property Value

bool

CancelButtonBounds

protected override Rectangle CancelButtonBounds { get; }

Property Value

Rectangle

CurrentFile

public string CurrentFile { get; }

Property Value

string

CurrentPath

public string CurrentPath { get; }

Property Value

string

DisplayMode

public FileDialogDisplayMode DisplayMode { get; set; }

Property Value

FileDialogDisplayMode

EffectiveCanCreateFolders

Matches Godot's _update_make_dir_visible: folder creation is force-disabled while merely picking a file/files to open, regardless of the CanCreateFolders customization flag.

public bool EffectiveCanCreateFolders { get; }

Property Value

bool

Entries

public IReadOnlyList<string> Entries { get; }

Property Value

IReadOnlyList<string>

EntryHeight

public float EntryHeight { get; set; }

Property Value

float

FileMode

public FileDialogMode FileMode { get; set; }

Property Value

FileDialogMode

FileSystem

public IFileDialogFileSystem FileSystem { get; set; }

Property Value

IFileDialogFileSystem

FilenameFilter

public string FilenameFilter { get; set; }

Property Value

string

FilterIndex

public int FilterIndex { get; set; }

Property Value

int

Filters

public IReadOnlyList<string> Filters { get; }

Property Value

IReadOnlyList<string>

GetIconCallback

public static Func<string, ThemeIcon?> GetIconCallback { get; set; }

Property Value

Func<string, ThemeIcon?>

GetThumbnailCallback

public static Func<string, int, ThemeIcon?> GetThumbnailCallback { get; set; }

Property Value

Func<string, int, ThemeIcon?>

IsFileSystemAvailable

public bool IsFileSystemAvailable { get; }

Property Value

bool

IsOverwriteConfirmationVisible

public bool IsOverwriteConfirmationVisible { get; }

Property Value

bool

Message

Non-empty when the last Refresh hit a permission error, matching Godot's own "You don't have permission..." message label shown in place of the file list.

public string Message { get; }

Property Value

string

ModeOverridesTitle

public bool ModeOverridesTitle { get; set; }

Property Value

bool

NativeDialogHandler

public static Func<FileDialog, bool> NativeDialogHandler { get; set; }

Property Value

Func<FileDialog, bool>

OkButtonBounds

protected override Rectangle OkButtonBounds { get; }

Property Value

Rectangle

Options

public IReadOnlyList<FileDialogOption> Options { get; }

Property Value

IReadOnlyList<FileDialogOption>

OverwriteConfirmationDialog

public ConfirmationDialog OverwriteConfirmationDialog { get; }

Property Value

ConfirmationDialog

OverwriteWarningEnabled

public bool OverwriteWarningEnabled { get; set; }

Property Value

bool

PendingOverwritePath

public string PendingOverwritePath { get; }

Property Value

string

RootSubfolder

public string RootSubfolder { get; set; }

Property Value

string

SelectedFiles

public IReadOnlyList<string> SelectedFiles { get; }

Property Value

IReadOnlyList<string>

ShowFilenameFilter

public bool ShowFilenameFilter { get; set; }

Property Value

bool

ShowHiddenFiles

public bool ShowHiddenFiles { get; set; }

Property Value

bool

SortOption

public FileDialogSortOption SortOption { get; set; }

Property Value

FileDialogSortOption

UseNativeDialog

public bool UseNativeDialog { get; set; }

Property Value

bool

Methods

ActivateEntry(int)

public void ActivateEntry(int index)

Parameters

index int

AddFilter(string)

public void AddFilter(string filter)

Parameters

filter string

AddOption(string, IEnumerable<string>, int)

public void AddOption(string name, IEnumerable<string> values, int defaultValueIndex = 0)

Parameters

name string
values IEnumerable<string>
defaultValueIndex int

ArrangeChildren()

protected override void ArrangeChildren()

CancelPendingOverwrite()

public void CancelPendingOverwrite()

ClearFilenameFilter()

public void ClearFilenameFilter()

ClearFilters()

public void ClearFilters()

ClearSelection()

public void ClearSelection()

Confirm()

public override void Confirm()

ConfirmPendingOverwrite()

public void ConfirmPendingOverwrite()

CreateFolder(string)

public string CreateFolder(string name)

Parameters

name string

Returns

string

DeselectAll()

public void DeselectAll()

GetCurrentDir()

public string GetCurrentDir()

Returns

string

GetCurrentFile()

public string GetCurrentFile()

Returns

string

GetCurrentPath()

public string GetCurrentPath()

Returns

string

GetDefaultDisplayMode()

public static FileDialogDisplayMode GetDefaultDisplayMode()

Returns

FileDialogDisplayMode

GetDefaultShowHiddenFiles()

public static bool GetDefaultShowHiddenFiles()

Returns

bool

GetFavoriteList()

public static IReadOnlyList<string> GetFavoriteList()

Returns

IReadOnlyList<string>

GetFileMode()

public FileDialogMode GetFileMode()

Returns

FileDialogMode

GetFilterIndex()

public int GetFilterIndex()

Returns

int

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2

GetOptionCount()

public int GetOptionCount()

Returns

int

GetOptionDefault(int)

public int GetOptionDefault(int option)

Parameters

option int

Returns

int

GetOptionName(int)

public string GetOptionName(int option)

Parameters

option int

Returns

string

GetOptionValues(int)

public IReadOnlyList<string> GetOptionValues(int option)

Parameters

option int

Returns

IReadOnlyList<string>

GetRecentList()

public static IReadOnlyList<string> GetRecentList()

Returns

IReadOnlyList<string>

GetRootSubfolder()

public string GetRootSubfolder()

Returns

string

GetSelectedFiles()

public IReadOnlyList<string> GetSelectedFiles()

Returns

IReadOnlyList<string>

GetSelectedOptions()

public IReadOnlyDictionary<string, object> GetSelectedOptions()

Returns

IReadOnlyDictionary<string, object>

GoBack()

Navigates to the previously-visited directory without disturbing forward history, matching Godot's _go_back (which calls _change_dir directly, bypassing _push_history).

public void GoBack()

GoForward()

Redoes a GoBack(), matching Godot's _go_forward.

public void GoForward()

GoUp()

public void GoUp()

Invalidate()

public void Invalidate()

IsCustomizationFlagEnabled(FileDialogCustomization)

public bool IsCustomizationFlagEnabled(FileDialogCustomization flag)

Parameters

flag FileDialogCustomization

Returns

bool

IsModeOverridingTitle()

public bool IsModeOverridingTitle()

Returns

bool

NavigateTo(string)

public void NavigateTo(string path)

Parameters

path string

PopupFileDialog()

public bool PopupFileDialog()

Returns

bool

Refresh(string)

public void Refresh(string path)

Parameters

path string

SelectEntry(int, bool)

public void SelectEntry(int index, bool append = false)

Parameters

index int
append bool

SelectFile(string, bool)

public void SelectFile(string path, bool append = false)

Parameters

path string
append bool

SetCurrentDir(string)

public void SetCurrentDir(string path)

Parameters

path string

SetCurrentFile(string)

public void SetCurrentFile(string path)

Parameters

path string

SetCurrentPath(string)

public void SetCurrentPath(string path)

Parameters

path string

SetCustomizationFlagEnabled(FileDialogCustomization, bool)

public void SetCustomizationFlagEnabled(FileDialogCustomization flag, bool enabled)

Parameters

flag FileDialogCustomization
enabled bool

SetDefaultDisplayMode(FileDialogDisplayMode)

public static void SetDefaultDisplayMode(FileDialogDisplayMode mode)

Parameters

mode FileDialogDisplayMode

SetDefaultShowHiddenFiles(bool)

public static void SetDefaultShowHiddenFiles(bool show)

Parameters

show bool

SetFavoriteList(IEnumerable<string>)

public static void SetFavoriteList(IEnumerable<string> favorites)

Parameters

favorites IEnumerable<string>

SetFileMode(FileDialogMode)

public void SetFileMode(FileDialogMode mode)

Parameters

mode FileDialogMode

SetFilterIndex(int)

public void SetFilterIndex(int index)

Parameters

index int

SetFilters(IEnumerable<string>)

public void SetFilters(IEnumerable<string> filters)

Parameters

filters IEnumerable<string>

SetModeOverridesTitle(bool)

public void SetModeOverridesTitle(bool enabled)

Parameters

enabled bool

SetOptionCount(int)

public void SetOptionCount(int count)

Parameters

count int

SetOptionDefault(int, int)

public void SetOptionDefault(int option, int defaultValueIndex)

Parameters

option int
defaultValueIndex int

SetOptionName(int, string)

public void SetOptionName(int option, string name)

Parameters

option int
name string

SetOptionValues(int, IEnumerable<string>)

public void SetOptionValues(int option, IEnumerable<string> values)

Parameters

option int
values IEnumerable<string>

SetRecentList(IEnumerable<string>)

public static void SetRecentList(IEnumerable<string> recents)

Parameters

recents IEnumerable<string>

SetRootSubfolder(string)

public void SetRootSubfolder(string path)

Parameters

path string

ToggleCurrentDirectoryFavorite()

public void ToggleCurrentDirectoryFavorite()

Events

DirectorySelected

public event Action<FileDialog, string> DirectorySelected

Event Type

Action<FileDialog, string>

FileSelected

public event Action<FileDialog, string> FileSelected

Event Type

Action<FileDialog, string>

FilenameFilterChanged

public event Action<FileDialog, string> FilenameFilterChanged

Event Type

Action<FileDialog, string>

FilesSelected

public event Action<FileDialog, IReadOnlyList<string>> FilesSelected

Event Type

Action<FileDialog, IReadOnlyList<string>>

FolderCreated

public event Action<FileDialog, string> FolderCreated

Event Type

Action<FileDialog, string>