mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00

* Add constants for emojis * Move emoji shortcode rendering to Markup * Add documentation * Add example * Add tests
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using Spectre.Console;
|
|
|
|
namespace Info
|
|
{
|
|
public static class Program
|
|
{
|
|
public static void Main()
|
|
{
|
|
var grid = new Grid()
|
|
.AddColumn(new GridColumn().NoWrap().PadRight(4))
|
|
.AddColumn()
|
|
.AddRow("[b]:artist_palette: Color system[/]", $"{AnsiConsole.Capabilities.ColorSystem}")
|
|
.AddRow("[b]:nail_polish: Supports ansi?[/]", $"{GetEmoji(AnsiConsole.Capabilities.SupportsAnsi)}")
|
|
.AddRow("[b]:top_hat: Legacy console?[/]", $"{GetEmoji(AnsiConsole.Capabilities.LegacyConsole)}")
|
|
.AddRow("[b]:left_right_arrow: Buffer width[/]", $"{AnsiConsole.Console.Width}")
|
|
.AddRow("[b]:up_down_arrow: Buffer height[/]", $"{AnsiConsole.Console.Height}");
|
|
|
|
AnsiConsole.Render(
|
|
new Panel(grid)
|
|
.SetHeader("Information"));
|
|
}
|
|
|
|
private static string GetEmoji(bool value) => value
|
|
? ":thumbs_up:"
|
|
: ":thumbs_down:";
|
|
}
|
|
}
|