Table of Contents

Class FileDialogs

Namespace
PluginUI
Assembly
PluginUI.dll

Modern Windows file dialogs (IFileOpenDialog / IFileSaveDialog), owned by the host window. Modal: they run a nested message loop, call them from the UI thread.

public static class FileDialogs
Inheritance
FileDialogs
Inherited Members

Methods

OpenFile(UIHost?, string, IReadOnlyList<FileFilter>?, string?)

Asks for one file to open. Returns null if cancelled.

public static string? OpenFile(UIHost? owner, string title, IReadOnlyList<FileFilter>? filters = null, string? initialFolder = null)

Parameters

owner UIHost
title string
filters IReadOnlyList<FileFilter>
initialFolder string

Returns

string

OpenFiles(UIHost?, string, IReadOnlyList<FileFilter>?, string?)

Asks for one or more files to open. Returns an empty list if cancelled.

public static IReadOnlyList<string> OpenFiles(UIHost? owner, string title, IReadOnlyList<FileFilter>? filters = null, string? initialFolder = null)

Parameters

owner UIHost
title string
filters IReadOnlyList<FileFilter>
initialFolder string

Returns

IReadOnlyList<string>

PickFolder(UIHost?, string, string?)

Asks for a folder. Returns null if cancelled.

public static string? PickFolder(UIHost? owner, string title, string? initialFolder = null)

Parameters

owner UIHost
title string
initialFolder string

Returns

string

SaveFile(UIHost?, string, IReadOnlyList<FileFilter>?, string?, string?, string?)

Asks for a destination file. Returns null if cancelled.

public static string? SaveFile(UIHost? owner, string title, IReadOnlyList<FileFilter>? filters = null, string? defaultFileName = null, string? defaultExtension = null, string? initialFolder = null)

Parameters

owner UIHost
title string
filters IReadOnlyList<FileFilter>
defaultFileName string
defaultExtension string
initialFolder string

Returns

string