Rewrite of nativefiledailog for C#
$ dotnet add package SharpFileDialogThis 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
{
void Main()
{
if (NativeFileDialog.PickFolder(null, out string? folder))
Console.WriteLine("Selected Folder: " + folder);
else
Console.WriteLine("Dialog was closed");
}
}
Currently supported dialog providers:
There is no way to add your own provider without recompiling library because class NativeFileDialog searches for providers inside library, but not outside
But if you really need to add it, just create new class in project that inherits interface INativeDialogProvider and add implementations