« Spectre.Console » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications
 
(7 versions intermédiaires par le même utilisateur non affichées)
Ligne 2 : Ligne 2 :
= Links =
= Links =
* [https://spectreconsole.net Spectre.Console]
* [https://spectreconsole.net Spectre.Console]
* [https://spectreconsole.net/appendix/colors Colors]


= [https://spectreconsole.net/markup Markup] =
= [https://spectreconsole.net/markup Markup] =
<kode lang='cs'>
<kode lang='cs'>
AnsiConsole.MarkupLine("[green]One[/] [underline green]Two[/] [bold green]Three[/]");
AnsiConsole.MarkupLine("[green]One[/] [underline green]Two[/] [bold green]Three[/]");
// background
AnsiConsole.MarkupLine("[default on blue]One[/] [bold yellow on blue]Two[/]");
var message = "One";
AnsiConsole.MarkupLineInterpolated($"[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): _
var password = AnsiConsole.Prompt(
    new TextPrompt<string>("Enter password: ")
        .PromptStyle("blue")
        .Secret());
</kode>
</kode>



Dernière version du 27 août 2023 à 21:03

Links

Markup

Cs.svg
AnsiConsole.MarkupLine("[green]One[/] [underline green]Two[/] [bold green]Three[/]");
// background
AnsiConsole.MarkupLine("[default on blue]One[/] [bold yellow on blue]Two[/]");

var message = "One";
AnsiConsole.MarkupLineInterpolated($"[red]{message}[/]");

Text prompt

Cs.svg
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): _

var password = AnsiConsole.Prompt(
    new TextPrompt<string>("Enter password: ")
        .PromptStyle("blue")
        .Secret());

Installation

Bash.svg
dotnet add package Spectre.Console