mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00

committed by
Phil Scott

parent
8fed3bc575
commit
225305f90e
2
examples/Console/Minimal/GlobalUsings.cs
Normal file
2
examples/Console/Minimal/GlobalUsings.cs
Normal file
@ -0,0 +1,2 @@
|
||||
global using Spectre.Console;
|
||||
global using static Spectre.Console.AnsiConsole;
|
16
examples/Console/Minimal/Minimal.csproj
Normal file
16
examples/Console/Minimal/Minimal.csproj
Normal file
@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ExampleTitle>Minimal</ExampleTitle>
|
||||
<ExampleDescription>Demonstrates a minimal console application.</ExampleDescription>
|
||||
<ExampleGroup>Live</ExampleGroup>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Shared\Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
13
examples/Console/Minimal/Program.cs
Normal file
13
examples/Console/Minimal/Program.cs
Normal file
@ -0,0 +1,13 @@
|
||||
// Write a markup line to the console
|
||||
MarkupLine("[yellow]Hello[/], [blue]World[/]!");
|
||||
|
||||
// Write text to the console
|
||||
WriteLine("Hello, World!");
|
||||
|
||||
// Write a table to the console
|
||||
Write(new Table()
|
||||
.RoundedBorder()
|
||||
.AddColumns("[red]Greeting[/]", "[red]Subject[/]")
|
||||
.AddRow("[yellow]Hello[/]", "World")
|
||||
.AddRow("[green]Oh hi[/]", "[blue u]Mark[/]"));
|
||||
|
Reference in New Issue
Block a user