コード例 #1
0
        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();
        }
コード例 #2
0
 public FakeConsole(
     int width = 80, int height = 9000, Encoding encoding = null,
     bool supportsAnsi = true, ColorSystem colorSystem = ColorSystem.Standard,
     bool legacyConsole = false, bool interactive = true)
 {
     Capabilities = new Capabilities(supportsAnsi, colorSystem, legacyConsole, interactive);
     Encoding = encoding ?? Encoding.UTF8;
     Width = width;
     Height = height;
     Writer = new StringWriter();
     Input = new FakeConsoleInput();
     Pipeline = new RenderPipeline();
 }
コード例 #3
0
        public FakeConsole(
            int width          = 80, int height = 9000, Encoding encoding = null,
            bool supportsAnsi  = true, ColorSystem colorSystem = ColorSystem.Standard,
            bool legacyConsole = false, bool interactive       = true)
        {
            Input    = new FakeConsoleInput();
            Pipeline = new RenderPipeline();

            Profile                          = new Profile(new StringWriter(), encoding ?? Encoding.UTF8);
            Profile.Width                    = width;
            Profile.Height                   = height;
            Profile.ColorSystem              = colorSystem;
            Profile.Capabilities.Ansi        = supportsAnsi;
            Profile.Capabilities.Legacy      = legacyConsole;
            Profile.Capabilities.Interactive = interactive;
            Profile.Capabilities.Links       = true;
        }
コード例 #4
0
        public FakeAnsiConsole(
            ColorSystem system, AnsiSupport ansi = AnsiSupport.Yes,
            InteractionSupport interaction       = InteractionSupport.Yes,
            int width = 80)
        {
            _writer  = new StringWriter();
            _console = AnsiConsole.Create(new AnsiConsoleSettings
            {
                Ansi                  = ansi,
                ColorSystem           = (ColorSystemSupport)system,
                Interactive           = interaction,
                Out                   = _writer,
                LinkIdentityGenerator = new FakeLinkIdentityGenerator(1024),
            });

            Width = width;
            Input = new FakeConsoleInput();
        }
コード例 #5
0
        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();
        }