« Spectre.Console » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
(→Links) |
(→Markup) |
||
Ligne 12 : | Ligne 12 : | ||
var message = "One"; | var message = "One"; | ||
AnsiConsole.MarkupInterpolated($"[red]{message}[/]"); | AnsiConsole.MarkupInterpolated($"[red]{message}[/]"); | ||
</kode> | |||
= [https://spectreconsole.net/prompts/text Text prompt] = | |||
<kode lang='cs'> | |||
if (!AnsiConsole.Confirm("Do you want to continue?")) // Do you want to continue? [y/n] (y): _ | |||
if (!AnsiConsole.Confirm("Do you want to quit?", false)) // Do you want to quit? [y/n] (n): _ | |||
</kode> | </kode> | ||
Version du 27 août 2023 à 20:48
Links
Markup
AnsiConsole.MarkupLine("[green]One[/] [underline green]Two[/] [bold green]Three[/]"); // background AnsiConsole.Markup("[default on blue]One[/] [bold yellow on blue]Two[/]"); var message = "One"; AnsiConsole.MarkupInterpolated($"[red]{message}[/]"); |
Text prompt
if (!AnsiConsole.Confirm("Do you want to continue?")) // Do you want to continue? [y/n] (y): _ if (!AnsiConsole.Confirm("Do you want to quit?", false)) // Do you want to quit? [y/n] (n): _ |
Installation
dotnet add package Spectre.Console |