mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 05:18:16 +08:00
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:

committed by
Phil Scott

parent
2fe2bb3c32
commit
3545e0f6b5
@ -2,7 +2,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Injection.Commands
|
||||
namespace Spectre.Console.Examples
|
||||
{
|
||||
public sealed class DefaultCommand : Command<DefaultCommand.Settings>
|
||||
{
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace Injection
|
||||
namespace Spectre.Console.Examples
|
||||
{
|
||||
public interface IGreeter
|
||||
{
|
||||
@ -11,7 +9,7 @@ namespace Injection
|
||||
{
|
||||
public void Greet(string name)
|
||||
{
|
||||
Console.WriteLine($"Hello {name}!");
|
||||
AnsiConsole.WriteLine($"Hello {name}!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Injection
|
||||
namespace Spectre.Console.Examples
|
||||
{
|
||||
public sealed class TypeRegistrar : ITypeRegistrar
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Injection
|
||||
namespace Spectre.Console.Examples
|
||||
{
|
||||
public sealed class TypeResolver : ITypeResolver, IDisposable
|
||||
{
|
||||
|
@ -15,7 +15,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\Spectre.Console\Spectre.Console.csproj" />
|
||||
<ProjectReference Include="..\..\Shared\Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,8 +1,7 @@
|
||||
using Injection.Commands;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Injection
|
||||
namespace Spectre.Console.Examples
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
|
Reference in New Issue
Block a user