Obsolete the AnsiConsoleFactory class (#585)

`AnsiConsoleFactory` should be an internal static class. Creating an `IAnsiConsole` can be achieved through `Spectre.Console.AnsiConsole.Create(AnsiConsoleSettings)`

Since `AnsiConsoleFactory` is public, it can't be changed from a non static class to a static class so obsoleting it is the second best thing to do.

Eventually, when `AnsiConsoleFactory` becomes internal and static, `AnsiConsole.Create` can be simplified to this (and the private static field `_factory` can be removed)

```
public static IAnsiConsole Create(AnsiConsoleSettings settings)
{
    return AnsiConsoleFactory.Create(settings);
}
```
This commit is contained in:
Cédric Luthi
2022-03-22 22:36:04 +01:00
committed by GitHub
parent 1d8154f9b0
commit 7998ece6b6
3 changed files with 7 additions and 4 deletions

View File

@ -56,8 +56,7 @@ public sealed class TestConsole : IAnsiConsole, IDisposable
Input = new TestConsoleInput();
EmitAnsiSequences = false;
var factory = new AnsiConsoleFactory();
_console = factory.Create(new AnsiConsoleSettings
_console = AnsiConsole.Create(new AnsiConsoleSettings
{
Ansi = AnsiSupport.Yes,
ColorSystem = (ColorSystemSupport)ColorSystem.TrueColor,