public FakeAnsiConsole( ColorSystem colors, AnsiSupport ansi = AnsiSupport.Yes, int width = 80) { _exclusivityLock = new FakeExclusivityMode(); _writer = new StringWriter(); var factory = new AnsiConsoleFactory(); _console = factory.Create(new AnsiConsoleSettings { Ansi = ansi, ColorSystem = (ColorSystemSupport)colors, Out = _writer, Enrichment = new ProfileEnrichment { UseDefaultEnrichers = false, }, }); _console.Profile.Width = width; _console.Profile.Capabilities.Unicode = true; Input = new FakeConsoleInput(); }
/// <summary> /// Initializes a new instance of the <see cref="TestConsole"/> class. /// </summary> public TestConsole() { _writer = new StringWriter(); _cursor = new NoopCursor(); Input = new TestConsoleInput(); EmitAnsiSequences = false; var factory = new AnsiConsoleFactory(); _console = factory.Create(new AnsiConsoleSettings { Ansi = AnsiSupport.Yes, ColorSystem = (ColorSystemSupport)ColorSystem.TrueColor, Out = new AnsiConsoleOutput(_writer), Interactive = InteractionSupport.No, ExclusivityMode = new NoopExclusivityMode(), Enrichment = new ProfileEnrichment { UseDefaultEnrichers = false, }, }); _console.Profile.Width = 80; _console.Profile.Height = 24; _console.Profile.Capabilities.Ansi = true; _console.Profile.Capabilities.Unicode = true; }
public FakeAnsiConsole( ColorSystem system, AnsiSupport ansi = AnsiSupport.Yes, int width = 80) { _writer = new StringWriter(); var factory = new AnsiConsoleFactory(); _console = factory.Create(new AnsiConsoleSettings { Ansi = ansi, ColorSystem = (ColorSystemSupport)system, Out = _writer, Enrichment = new ProfileEnrichment { UseDefaultEnrichers = false, }, }); _console.Profile.Width = width; Input = new FakeConsoleInput(); }
/// <summary> /// Creates a new <see cref="IAnsiConsole"/> instance /// from the provided settings. /// </summary> /// <param name="settings">The settings to use.</param> /// <returns>An <see cref="IAnsiConsole"/> instance.</returns> public static IAnsiConsole Create(AnsiConsoleSettings settings) { return(_factory.Create(settings)); }