Table of Contents

Interface IDialogs

Namespace
Playnite
Assembly
Playnite.SDK.dll

Describes object providing methods for dialog based actions.

public interface IDialogs

Methods

ChooseImageFileAsync(IEnumerable<ChooseDialogImageItem>, string?, double, double)

Task<ChooseDialogImageItem?> ChooseImageFileAsync(IEnumerable<ChooseDialogImageItem> files, string? caption = null, double itemWidth = 240, double itemHeight = 180)

Parameters

files IEnumerable<ChooseDialogImageItem>
caption string
itemWidth double
itemHeight double

Returns

Task<ChooseDialogImageItem>

ChooseImageWithSearchAsync(string, Func<ChooseItemWithSearchAsyncArgs, Task<IEnumerable<ChooseDialogImageItem>>>, string?, double, double)

Task<ChooseDialogImageItem?> ChooseImageWithSearchAsync(string initialSearch, Func<ChooseItemWithSearchAsyncArgs, Task<IEnumerable<ChooseDialogImageItem>>> searchFunction, string? caption = null, double itemWidth = 240, double itemHeight = 180)

Parameters

initialSearch string
searchFunction Func<ChooseItemWithSearchAsyncArgs, Task<IEnumerable<ChooseDialogImageItem>>>
caption string
itemWidth double
itemHeight double

Returns

Task<ChooseDialogImageItem>

ChooseItemAsync(IEnumerable<ChooseDialogItem>, string?)

Task<ChooseDialogItem?> ChooseItemAsync(IEnumerable<ChooseDialogItem> items, string? caption = null)

Parameters

items IEnumerable<ChooseDialogItem>
caption string

Returns

Task<ChooseDialogItem>

ChooseItemWithSearchAsync(string, Func<ChooseItemWithSearchAsyncArgs, Task<IEnumerable<ChooseDialogItem>>>, string?)

Task<ChooseDialogItem?> ChooseItemWithSearchAsync(string initialSearch, Func<ChooseItemWithSearchAsyncArgs, Task<IEnumerable<ChooseDialogItem>>> searchFunction, string? caption = null)

Parameters

initialSearch string
searchFunction Func<ChooseItemWithSearchAsyncArgs, Task<IEnumerable<ChooseDialogItem>>>
caption string

Returns

Task<ChooseDialogItem>

CreateWindow(WindowCreationOptions)

Creates new window with Playnite's default styling applied.

Window CreateWindow(WindowCreationOptions options)

Parameters

options WindowCreationOptions

Custom window options.

Returns

Window

New window instance.

GetLastActiveWindow()

Gets currently active window. If no window is active, main window is returned instead.

Window? GetLastActiveWindow()

Returns

Window

Window object.

SaveFileAsync(Dictionary<string, string[]>?, bool, string?)

Task<string?> SaveFileAsync(Dictionary<string, string[]>? fileTypeChoices = null, bool promptOverwrite = true, string? initialDir = null)

Parameters

fileTypeChoices Dictionary<string, string[]>
promptOverwrite bool
initialDir string

Returns

Task<string>

SelectFileAsync(Dictionary<string, string[]>?, bool, string?)

Task<List<string>?> SelectFileAsync(Dictionary<string, string[]>? fileTypeChoices = null, bool allowMultiple = false, string? initialDir = null)

Parameters

fileTypeChoices Dictionary<string, string[]>
allowMultiple bool
initialDir string

Returns

Task<List<string>>

SelectFolderAsync(string?, bool)

Task<List<string>?> SelectFolderAsync(string? initialDir = null, bool allowMultiple = false)

Parameters

initialDir string
allowMultiple bool

Returns

Task<List<string>>

SelectImagefileAsync(bool, string?)

Task<List<string>?> SelectImagefileAsync(bool allowMultiple = false, string? initialDir = null)

Parameters

allowMultiple bool
initialDir string

Returns

Task<List<string>>

SelectStringAsync(string, string, string)

Task<StringSelectionDialogResult> SelectStringAsync(string messageBoxText, string caption, string defaultInput)

Parameters

messageBoxText string
caption string
defaultInput string

Returns

Task<StringSelectionDialogResult>

SelectStringAsync(string, string, string, List<MessageBoxResponse>, List<MessageBoxOption>)

Task<StringSelectionDialogResult> SelectStringAsync(string messageBoxText, string caption, string defaultInput, List<MessageBoxResponse> responses, List<MessageBoxOption> options)

Parameters

messageBoxText string
caption string
defaultInput string
responses List<MessageBoxResponse>
options List<MessageBoxOption>

Returns

Task<StringSelectionDialogResult>

ShowAsyncBlockingProgressAsync(GlobalProgressOptions, Func<IGlobalProgressActionArgs, Task>)

Task<GlobalProgressResult> ShowAsyncBlockingProgressAsync(GlobalProgressOptions progressOptions, Func<IGlobalProgressActionArgs, Task> progresAction)

Parameters

progressOptions GlobalProgressOptions
progresAction Func<IGlobalProgressActionArgs, Task>

Returns

Task<GlobalProgressResult>

ShowBlockingProgressAsync(GlobalProgressOptions, Action<IGlobalProgressActionArgs>)

Task<GlobalProgressResult> ShowBlockingProgressAsync(GlobalProgressOptions progressOptions, Action<IGlobalProgressActionArgs> progresAction)

Parameters

progressOptions GlobalProgressOptions
progresAction Action<IGlobalProgressActionArgs>

Returns

Task<GlobalProgressResult>

ShowErrorMessageAsync(string, string?, Exception?)

Task<MessageBoxResult> ShowErrorMessageAsync(string messageBoxText, string? caption = null, Exception? exception = null)

Parameters

messageBoxText string
caption string
exception Exception

Returns

Task<MessageBoxResult>

ShowMessageAsync(string, string?, MessageBoxButtons, MessageBoxSeverity, MessageBoxResult)

Task<MessageBoxResult> ShowMessageAsync(string messageBoxText, string? caption = null, MessageBoxButtons button = MessageBoxButtons.OK, MessageBoxSeverity severity = MessageBoxSeverity.None, MessageBoxResult defaultResult = MessageBoxResult.None)

Parameters

messageBoxText string
caption string
button MessageBoxButtons
severity MessageBoxSeverity
defaultResult MessageBoxResult

Returns

Task<MessageBoxResult>

ShowMessageAsync(string, string, MessageBoxSeverity, List<MessageBoxResponse>, List<MessageBoxOption>)

Task<MessageBoxResponse?> ShowMessageAsync(string messageBoxText, string caption, MessageBoxSeverity severity, List<MessageBoxResponse> respones, List<MessageBoxOption> options)

Parameters

messageBoxText string
caption string
severity MessageBoxSeverity
respones List<MessageBoxResponse>
options List<MessageBoxOption>

Returns

Task<MessageBoxResponse>

ShowSelectableStringAsync(string, string, string)

Task ShowSelectableStringAsync(string messageBoxText, string caption, string defaultInput)

Parameters

messageBoxText string
caption string
defaultInput string

Returns

Task