TinyDialogsNet 2.0.0

dotnet add package TinyDialogsNet --version 2.0.0
NuGet\Install-Package TinyDialogsNet -Version 2.0.0
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="TinyDialogsNet" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TinyDialogsNet --version 2.0.0
#r "nuget: TinyDialogsNet, 2.0.0"
#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.
// Install TinyDialogsNet as a Cake Addin
#addin nuget:?package=TinyDialogsNet&version=2.0.0

// Install TinyDialogsNet as a Cake Tool
#tool nuget:?package=TinyDialogsNet&version=2.0.0

TinyDialogsNet

TinyDialogsNet is a C# wrapper around tinyfiledialogs, which is a C/C++ library for displaying dialogs with a simple interface in mind. This library aims to replicate the same easiness of use, which includes abstracting any UTF string conversions and Interop stuff away from the user.

Supported platforms

Since tinyfiledialogs is a C/C++ library, it comes with a set of native library files which are contained in the runtimes folder. Such files are included for the following platforms:

OS x86 x64 arm64
Windows
Linux
OSX

Installation

You can:

  • Build the library from source and include it in your project manually.
    • git clone https://github.com/nedoxff/TinyDialogsNet
    • cd TinyDialogsNet
    • dotnet build --configuration Release (you'll need .NET8 for this)
    • The output will be in bin/Release/net6.0, bin/Release/net7.0 and bin/Release/net8.0 (don't forget the runtimes folder!)
  • Install the library from NuGet.

Usage

The library provides support for these dialogs:

  • Notification popup
    // NotificationIconType also has Error & Information properties
    TinyDialogs.NotifyPopup(NotificationIconType.Information, "Title", "Message");
    
  • Message box
    var response = TinyDialogs.MessageBox("Title", "Message", MessageBoxDialogType.YesNo,  // which buttons to show
                                                              MessageBoxIconType.Question, // which icon to show
                                                              MessageBoxButton.Yes);       // the default button
    // response is a MessageBoxButton which has Ok, Yes, No & Cancel properties
    
  • Input box
    // InputBoxType also has the Password property
    var (canceled, text) = TinyDialogs.InputBox(InputBoxType.Text, "Title", "Description", "Placeholder");
    
  • Save file dialog
    var filter = new FileFilter("Image files", ["*.jpg", "*.png"]);
    var (canceled, path) = TinyDialogs.SaveFileDialog("Title", "Default path", filter);
    
  • Open file dialog
    var filter = new FileFilter("Image files", ["*.jpg", "*.png"]);
    var allowMultipleSelections = true;
    var (canceled, paths) = TinyDialogs.OpenFileDialog("Title", "Default path", allowMultipleSelections, filter);
    
  • Select folder dialog
    var (canceled, path) = TinyDialogs.SelectFolderDialog("Title", "Default path");
    
  • Color chooser dialog
    var (canceled, color) = TinyDialogs.ColorChooser("Title", "Default color (#RRGGBB)");
    
  • Beeper
    TinyDialogs.Beep();
    

One can also get and set native properties of the library:

var version = TinyDialogs.GetGlobalStringVariable(StringVariable.Version);
Console.WriteLine($"Using tinyfiledialogs v{version}");

// "0" if false, "1" if true
var verbose = TinyDialogs.GetGlobalIntegerVariable(IntegerVariable.Verbose);
TinyDialogs.SetGlobalIntegerVariable(IntegerVariable.Silent, 1);

Additional documentation can be found in the XML documentation of TinyDialogs.cs.

Contributing

If you find a bug or have a suggestion on how the library can be improved, please create an issue! I'll try to check them regularly.

Thank you

License

TinyDialogsNet is distributed under the MIT license. The original tinyfiledialogs library is distributed under the zlib license.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

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.0 85 6/6/2024