NativeFileDialogNET 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package NativeFileDialogNET --version 1.0.2
                    
NuGet\Install-Package NativeFileDialogNET -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NativeFileDialogNET" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NativeFileDialogNET" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="NativeFileDialogNET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NativeFileDialogNET --version 1.0.2
                    
#r "nuget: NativeFileDialogNET, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=NativeFileDialogNET&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=NativeFileDialogNET&version=1.0.2
                    
Install as a Cake Tool

NativeFileDialogNET

NativeFileDialogNET is a C# binding for the nativefiledialog-extended library. This project allows you to use native file dialog functionalities in your C# applications.

Usage

Here is a simple example of how to use the library:

using NativeFileDialogNET;

// Create a new instance of the dialog
using var dialog = new NativeFileDialog();

// Open a select file dialog
var selectResult = dialog.OpenSelectDialog(out string selectOutput, [new FilterItem { Name = "Text files", Spec = "txt" }]);

// Check the result
switch (selectResult)
{
    case DialogResult.Okay:
        Console.WriteLine($"Selected file: {selectOutput}");
        break;
    case DialogResult.Cancel:
        Console.WriteLine("User cancelled the dialog");
        break;
    default:
        Console.WriteLine("An error occurred");
        break;
}

// Open a save file dialog
var saveResult = dialog.OpenSaveDialog(out string saveOutput, [new FilterItem { Name = "Text files", Spec = "txt" }], Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "test.txt");

// Check the result
switch (saveResult)
{
    case DialogResult.Okay:
        Console.WriteLine($"Saved file path: {saveOutput}");
        break;
    case DialogResult.Cancel:
        Console.WriteLine("User cancelled the dialog");
        break;
    default:
        Console.WriteLine("An error occurred");
        break;
}

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the zlib License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 545 12/6/2024
2.0.1 132 12/1/2024
2.0.0 145 7/29/2024
1.0.2 152 4/24/2024
1.0.1 118 4/22/2024
1.0.0 107 4/22/2024

Added scoped methods (OpenSelectDialog, OpenSaveDialog)