This library is a rewrite of nativefiledialog for dotnet.
Include SharpFileDialog
namespace and run methods from static class NativeFileDialog
If you want to use filters just create and fill array of NativeFileDialog.Filter
structs
using SharpFileDialog;
class Example
{
static void Main()
{
if (NativeFileDialog.PickFolder(null, out string? folder))
Console.WriteLine("Selected Folder: " + folder);
else
Console.WriteLine("Dialog was closed");
}
}
Currently supported dialog providers:
- WinAPI (Auto add extension on file save supported)
- GTK
You can use custom provider by setting property NativeFileDialog.Provider
or bundled providers with method NativeFileDialog.SetDefaultProvider()
.
To create custom provider create new class, inherit interface INativeDialogProvider
and add implementations.