Add example infrastructure

* Add "Shared" projects for all examples
* Update "Colors" example with better TrueColor demo
* Use same namespace for all examples
This commit is contained in:
Patrik Svensson
2021-04-11 22:47:26 +02:00
committed by Phil Scott
parent 2fe2bb3c32
commit 3545e0f6b5
74 changed files with 271 additions and 355 deletions

View File

@ -1,7 +1,7 @@
using System.ComponentModel;
using Spectre.Console.Cli;
namespace Delegates
namespace Spectre.Console.Examples
{
public static partial class Program
{

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spectre.Console\Spectre.Console.csproj" />
<ProjectReference Include="..\..\Shared\Shared.csproj" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,6 @@
using System;
using Spectre.Console.Cli;
namespace Delegates
namespace Spectre.Console.Examples
{
public static partial class Program
{
@ -22,7 +21,7 @@ namespace Delegates
private static int Foo(CommandContext context)
{
Console.WriteLine("Foo");
AnsiConsole.WriteLine("Foo");
return 0;
}
@ -30,7 +29,7 @@ namespace Delegates
{
for (var index = 0; index < settings.Count; index++)
{
Console.WriteLine("Bar");
AnsiConsole.WriteLine("Bar");
}
return 0;