Interface IDialogsFactory
Describes object providing methods for dialog based actions.
public interface IDialogsFactory
Methods
ActivateGlobalProgress(Action<GlobalProgressActionArgs>, GlobalProgressOptions)
Activates progress dialog blocking app interaction until progress is finished or canceled.
GlobalProgressResult ActivateGlobalProgress(Action<GlobalProgressActionArgs> progresAction, GlobalProgressOptions progressOptions)
Parameters
progresActionAction<GlobalProgressActionArgs>Action to be executed.
progressOptionsGlobalProgressOptionsOptions for progress dialog.
Returns
- GlobalProgressResult
Status of the action execution.
ActivateGlobalProgress(Func<GlobalProgressActionArgs, Task>, GlobalProgressOptions)
Activates progress dialog blocking app interaction until progress is finished or canceled.
GlobalProgressResult ActivateGlobalProgress(Func<GlobalProgressActionArgs, Task> progresAction, GlobalProgressOptions progressOptions)
Parameters
progresActionFunc<GlobalProgressActionArgs, Task>Awaitable function to be executed.
progressOptionsGlobalProgressOptionsOptions for progress dialog.
Returns
- GlobalProgressResult
Status of the action execution.
ChooseImageFile(List<ImageFileOption>, string, double, double)
Displays dialog with an option to choose single image.
ImageFileOption ChooseImageFile(List<ImageFileOption> files, string caption = null, double itemWidth = 240, double itemHeight = 180)
Parameters
filesList<ImageFileOption>captionstringitemWidthdoubleitemHeightdouble
Returns
- ImageFileOption
Null if dialog was canceled otherwise selected ImageFileOption object.
ChooseItemWithSearch(List<GenericItemOption>, Func<string, List<GenericItemOption>>, string, string)
Displays dialog with an option to choose single item and option to search for different items.
GenericItemOption ChooseItemWithSearch(List<GenericItemOption> items, Func<string, List<GenericItemOption>> searchFunction, string defaultSearch = null, string caption = null)
Parameters
itemsList<GenericItemOption>searchFunctionFunc<string, List<GenericItemOption>>defaultSearchstringcaptionstring
Returns
- GenericItemOption
Null if dialog was canceled otherwise selected GenericItemOption object.
CreateWindow(WindowCreationOptions)
Creates new window with Playnite's default styling applied.
Window CreateWindow(WindowCreationOptions options)
Parameters
optionsWindowCreationOptionsCustom window options.
Returns
- Window
New window instance.
GetCurrentAppWindow()
Gets currently active window. If no window is active, main window is returned instead.
Window GetCurrentAppWindow()
Returns
- Window
Window object.
SaveFile(string)
Displays system file save dialog.
string SaveFile(string filter)
Parameters
filterstringFile filter, for example "ZIP Archive|*.zip"
Returns
- string
Selected file path or empty string if user cancels the dialog.
SaveFile(string, bool)
Displays system file save dialog.
string SaveFile(string filter, bool promptOverwrite)
Parameters
filterstringFile filter, for example "ZIP Archive|*.zip"
promptOverwriteboolIndicates whether to ask user for file overrite if selected path exists.
Returns
- string
Selected file path or empty string if user cancels the dialog.
SaveFile(string, bool, string)
string SaveFile(string filter, bool promptOverwrite, string initialDir)
Parameters
Returns
SaveFile(string, string)
string SaveFile(string filter, string initialDir)
Parameters
Returns
SelectFile(string)
Displays system open file dialog.
string SelectFile(string filter)
Parameters
filterstringFile filter, for example "ZIP Archive|*.zip"
Returns
- string
Selected file path or empty string if user cancels the dialog.
SelectFile(string, string)
string SelectFile(string filter, string initialDir)
Parameters
Returns
SelectFiles(string)
Displays system open file dialog allowing to select multiple files.
List<string> SelectFiles(string filter)
Parameters
filterstringFile filter, for example "ZIP Archive|*.zip"
Returns
SelectFiles(string, string)
List<string> SelectFiles(string filter, string initialDir)
Parameters
Returns
SelectFolder()
Displays system dialog for folder selection.
string SelectFolder()
Returns
- string
Selected folder path or empty string if user cancels the dialog.
SelectFolder(string)
string SelectFolder(string initialDir)
Parameters
initialDirstring
Returns
SelectIconFile()
Displays file open dialog with file filter set to show only image files used for icons.
string SelectIconFile()
Returns
- string
Selected icon path or empty string if user cancels the dialog.
SelectIconFile(string)
string SelectIconFile(string initialDir)
Parameters
initialDirstring
Returns
SelectImagefile()
Displays file open dialog with file filter set to show only image files.
string SelectImagefile()
Returns
- string
Selected image path or empty string if user cancels the dialog.
SelectImagefile(string)
string SelectImagefile(string initialDir)
Parameters
initialDirstring
Returns
SelectString(string, string, string)
Displays dialog asking user to input text string.
StringSelectionDialogResult SelectString(string messageBoxText, string caption, string defaultInput)
Parameters
messageBoxTextstringDialog message text.
captionstringDialog window caption.
defaultInputstringDefault string presented in input field.
Returns
- StringSelectionDialogResult
Selection result.
SelectString(string, string, string, List<MessageBoxToggle>)
StringSelectionDialogResult SelectString(string messageBoxText, string caption, string defaultInput, List<MessageBoxToggle> options)
Parameters
messageBoxTextstringcaptionstringdefaultInputstringoptionsList<MessageBoxToggle>
Returns
ShowErrorMessage(string)
Displays error dialog window with text message.
MessageBoxResult ShowErrorMessage(string messageBoxText)
Parameters
messageBoxTextstringDialog message text.
Returns
ShowErrorMessage(string, string)
Displays error dialog window with text message.
MessageBoxResult ShowErrorMessage(string messageBoxText, string caption)
Parameters
Returns
ShowMessage(string)
Displays dialog window with text message.
MessageBoxResult ShowMessage(string messageBoxText)
Parameters
messageBoxTextstringDialog message text.
Returns
- MessageBoxResult
Selected dialog response.
ShowMessage(string, string)
Displays dialog window with text message.
MessageBoxResult ShowMessage(string messageBoxText, string caption)
Parameters
Returns
- MessageBoxResult
Selected dialog response.
ShowMessage(string, string, MessageBoxButton)
Displays dialog window with text message.
MessageBoxResult ShowMessage(string messageBoxText, string caption, MessageBoxButton button)
Parameters
messageBoxTextstringDialog message text.
captionstringDialog window caption.
buttonMessageBoxButtonAvailable response button.
Returns
- MessageBoxResult
Selected dialog response.
ShowMessage(string, string, MessageBoxButton, MessageBoxImage)
Displays dialog window with text message.
MessageBoxResult ShowMessage(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon)
Parameters
messageBoxTextstringDialog message text.
captionstringDialog window caption.
buttonMessageBoxButtonAvailable response button.
iconMessageBoxImageDialog icon.
Returns
- MessageBoxResult
Selected dialog response.
ShowMessage(string, string, MessageBoxImage, List<MessageBoxOption>)
Displays dialog window custom response options.
MessageBoxOption ShowMessage(string messageBoxText, string caption, MessageBoxImage icon, List<MessageBoxOption> options)
Parameters
messageBoxTextstringDialog message text.
captionstringDialog window caption.
iconMessageBoxImageDialog icon.
optionsList<MessageBoxOption>Response options.
Returns
- MessageBoxOption
Selected dialog option.
ShowSelectableString(string, string, string)
Displays dialog with textbox allowing to select/copy text.
void ShowSelectableString(string messageBoxText, string caption, string defaultInput)