mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-06 04:28:15 +08:00
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:
@ -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,
|
||||
|
Reference in New Issue
Block a user