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
progresAction
Action<GlobalProgressActionArgs>Action to be executed.
progressOptions
GlobalProgressOptionsOptions 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
progresAction
Func<GlobalProgressActionArgs, Task>Awaitable function to be executed.
progressOptions
GlobalProgressOptionsOptions 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
files
List<ImageFileOption>caption
stringitemWidth
doubleitemHeight
double
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
items
List<GenericItemOption>searchFunction
Func<string, List<GenericItemOption>>defaultSearch
stringcaption
string
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
options
WindowCreationOptionsCustom 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
filter
stringFile 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
filter
stringFile filter, for example "ZIP Archive|*.zip"
promptOverwrite
boolIndicates whether to ask user for file overrite if selected path exists.
Returns
- string
Selected file path or empty string if user cancels the dialog.
SelectFile(string)
Displays system open file dialog.
string SelectFile(string filter)
Parameters
filter
stringFile filter, for example "ZIP Archive|*.zip"
Returns
- string
Selected file path or empty string if user cancels the dialog.
SelectFiles(string)
Displays system open file dialog allowing to select multiple files.
List<string> SelectFiles(string filter)
Parameters
filter
stringFile filter, for example "ZIP Archive|*.zip"
Returns
SelectFolder()
Displays system dialog for folder selection.
string SelectFolder()
Returns
- string
Selected folder path or empty string if user cancels the dialog.
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.
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.
SelectString(string, string, string)
Displays dialog asking user to input text string.
StringSelectionDialogResult SelectString(string messageBoxText, string caption, string defaultInput)
Parameters
messageBoxText
stringDialog message text.
caption
stringDialog window caption.
defaultInput
stringDefault 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
messageBoxText
stringcaption
stringdefaultInput
stringoptions
List<MessageBoxToggle>
Returns
ShowErrorMessage(string)
Displays error dialog window with text message.
MessageBoxResult ShowErrorMessage(string messageBoxText)
Parameters
messageBoxText
stringDialog 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
messageBoxText
stringDialog 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
messageBoxText
stringDialog message text.
caption
stringDialog window caption.
button
MessageBoxButtonAvailable 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
messageBoxText
stringDialog message text.
caption
stringDialog window caption.
button
MessageBoxButtonAvailable response button.
icon
MessageBoxImageDialog 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
messageBoxText
stringDialog message text.
caption
stringDialog window caption.
icon
MessageBoxImageDialog icon.
options
List<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)