LINQPadDialogs 0.5.5
dotnet add package LINQPadDialogs --version 0.5.5
NuGet\Install-Package LINQPadDialogs -Version 0.5.5
<PackageReference Include="LINQPadDialogs" Version="0.5.5" />
paket add LINQPadDialogs --version 0.5.5
#r "nuget: LINQPadDialogs, 0.5.5"
// Install LINQPadDialogs as a Cake Addin #addin nuget:?package=LINQPadDialogs&version=0.5.5 // Install LINQPadDialogs as a Cake Tool #tool nuget:?package=LINQPadDialogs&version=0.5.5
LINQPadDialogs
A helper library that provides the ability to implement interactive user interfaces using LINQPad's built-in Controls.
LINQPad 8 | LINQPad 5 |
---|---|
Please read before continuing
- This NuGet package is supported by the generosity of community members. A small donation through GitHub Sponsorship will go a long way toward keeping the project running. (Donate Now)
- This library is intended to be used with LINQPad. It is not recommended for use in production development code.
- This package also requires a license of at least the Developer Edition of LINQPad to use it.
- If you write a script using the features provided by this package, it may not be possible to run it with the
lprun
CLI tool.
Features
I will be gradually developing and supplementing this library.
Interactivity Features (Button Array)
It provides a simple async/await method to display multiple buttons, and to see what button the user has selected in the console.
If needed, you can customize the ButtonArray
types that are added to the LINQPad.Controls
namespace.
Here is an example of the code:
using LINQPad.Controls;
switch (await Dialog.YesNo<string>("Are you happy now?", "yes", "no"))
{
case "yes":
"Answer: Yes".Dump();
break;
case "no":
"Answer: No".Dump();
break;
default:
"Answer: ?".Dump();
break;
}
Interactivity Features (Prompt)
Draw a UI that allows you to type whatever you want into the text box. Unlike Console.In.ReadLine
methods, this feature shows a text box and OK and Cancel buttons on the screen.
Here is an example of the code:
using LINQPad.Controls;
var answer = await OKCancelPrompt("What's your name?");
if (answer == default) $"You didn't enter a name.".Dump();
else $"Your name is: {answer}.".Dump();
You can use the Choose or Multiple Choice prompts here.
using LINQPad.Controls;
// Single Choice
var answer = await Dialog.SelectOneAnswerPrompt("What's your favorite fruit?", default, "Apple", "Banana", "Kiwi", "Peach", "Watermelon");
$"Your favorite food is: {answer}".Dump();
// Multiple Choices
var answers = await Dialog.SelectMultipleAnswersPrompt("What's your favorite foods?", default, "Bulgogi", "Kimbap", "Ramen", "Kimchi Jjigae");
$"Your favorite foods are: {string.Join(", ", answers)}".Dump();
The ability to enter a password is also available.
using LINQPad.Controls;
var password = await Dialog.PasswordPrompt("Enter your password");
var encodedPassword = await Dialog.PasswordPromptAsBytes("Enter your password again", new UTF8Encoding(false));
License
This project is licensed under the Apache License 2.0.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 was computed. 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 was computed. 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. |
.NET Core | netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.0
- LINQPad.Runtime (>= 6.14.10)
-
.NETCoreApp 3.1
- LINQPad.Runtime (>= 7.8.7)
-
.NETFramework 4.6.1
- LINQPad (>= 5.46.0)
-
net6.0
- LINQPad.Runtime (>= 8.3.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.