Skip to main content
Version: 15.x (API 15) [Current]

Class FileDialogManager

A manager for the Dalamud.Interface.ImGuiFileDialog.FileDialog class.

Assembly: Dalamud.dll​
Declaration
public class FileDialogManager

Properties​

GetDefaultSortOrder​

Gets or sets a function that returns the desired default sort order in the file dialog.

Declaration
public Func<FileDialog.SortingField>? GetDefaultSortOrder { get; set; }

SetDefaultSortOrder​

Gets or sets an action to invoke when a file dialog changes its sort order.

Declaration
public Action<FileDialog.SortingField>? SetDefaultSortOrder { get; set; }

Fields​

CustomSideBarItems​

Additional quick access items for the sidebar.

Declaration
public readonly List<(string Name, string Path, FontAwesomeIcon Icon, int Position)> CustomSideBarItems

AddedWindowFlags​

Additional flags with which to draw the window.

Declaration
public ImGuiWindowFlags AddedWindowFlags

Methods​

OpenFolderDialog(string, Action<bool, string>)​

Create a dialog which selects an already existing folder.

Declaration
public void OpenFolderDialog(string title, Action<bool, string> callback)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.

OpenFolderDialog(string, Action<bool, string>, string?, bool)​

Create a dialog which selects an already existing folder.

Declaration
public void OpenFolderDialog(string title, Action<bool, string> callback, string? startPath, bool isModal = false)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.
System.StringstartPathThe directory which the dialog should start inside of. The last path this manager was in is used if this is null.
System.BooleanisModalWhether the dialog should be a modal popup.

SaveFolderDialog(string, string, Action<bool, string>)​

Create a dialog which selects an already existing folder or new folder.

Declaration
public void SaveFolderDialog(string title, string defaultFolderName, Action<bool, string> callback)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.StringdefaultFolderNameThe default name to use when creating a new folder.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.

SaveFolderDialog(string, string, Action<bool, string>, string?, bool)​

Create a dialog which selects an already existing folder or new folder.

Declaration
public void SaveFolderDialog(string title, string defaultFolderName, Action<bool, string> callback, string? startPath, bool isModal = false)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.StringdefaultFolderNameThe default name to use when creating a new folder.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.
System.StringstartPathThe directory which the dialog should start inside of. The last path this manager was in is used if this is null.
System.BooleanisModalWhether the dialog should be a modal popup.

OpenFileDialog(string, string, Action<bool, string>)​

Create a dialog which selects a single, already existing file.

Declaration
public void OpenFileDialog(string title, string filters, Action<bool, string> callback)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.StringfiltersWhich files to show in the dialog.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.

OpenFileDialog(string, string, Action<bool, List<string>>, int, string?, bool)​

Create a dialog which selects already existing files.

Declaration
public void OpenFileDialog(string title, string filters, Action<bool, List<string>> callback, int selectionCountMax, string? startPath = null, bool isModal = false)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.StringfiltersWhich files to show in the dialog.
System.Action<System.Boolean,System.Collections.Generic.List<System.String>>callbackThe action to execute when the dialog is finished.
System.Int32selectionCountMaxThe maximum amount of files or directories which can be selected. Set to 0 for an infinite number.
System.StringstartPathThe directory which the dialog should start inside of. The last path this manager was in is used if this is null.
System.BooleanisModalWhether the dialog should be a modal popup.

SaveFileDialog(string, string, string, string, Action<bool, string>)​

Create a dialog which selects an already existing folder or new file.

Declaration
public void SaveFileDialog(string title, string filters, string defaultFileName, string defaultExtension, Action<bool, string> callback)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.StringfiltersWhich files to show in the dialog.
System.StringdefaultFileNameThe default name to use when creating a new file.
System.StringdefaultExtensionThe extension to use when creating a new file.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.

SaveFileDialog(string, string, string, string, Action<bool, string>, string?, bool)​

Create a dialog which selects an already existing folder or new file.

Declaration
public void SaveFileDialog(string title, string filters, string defaultFileName, string defaultExtension, Action<bool, string> callback, string? startPath, bool isModal = false)
Parameters​
TypeNameDescription
System.StringtitleThe header title of the dialog.
System.StringfiltersWhich files to show in the dialog.
System.StringdefaultFileNameThe default name to use when creating a new file.
System.StringdefaultExtensionThe extension to use when creating a new file.
System.Action<System.Boolean,System.String>callbackThe action to execute when the dialog is finished.
System.StringstartPathThe directory which the dialog should start inside of. The last path this manager was in is used if this is null.
System.BooleanisModalWhether the dialog should be a modal popup.

Draw()​

Draws the current dialog, if any, and executes the callback if it is finished.

Declaration
public void Draw()

Reset()​

Removes the current dialog, if any.

Declaration
public void Reset()

Events​

SelectionChanged​

Event fires when a new file is selected by the user

Declaration
public event EventHandler<string>? SelectionChanged
Event Type​

System.EventHandler<System.String>: Returns the path of the file as a string