コード例 #1
0
            public void WriteLine(IConsoleProxy proxy)
            {
                foreach (var segment in Segments)
                {
                    proxy.Write(segment.Text, segment.Color);
                }

                proxy.Write("\n");
            }
コード例 #2
0
        public static void PrintBanner(IConsoleProxy proxy, ILogger logger)
        {
            proxy.Write("\n\n");

            var lines = new[]
            {
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMMMMMMMMMMMMMMMMdo`    ", logger.TextColor), new FormattedLineSegment("    hMMM+ +MMMh", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMMMMMMMMMMMMMMMMMMh    ", logger.TextColor), new FormattedLineSegment("   `MMMM` dMMM/", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-          `yMMMN    ", logger.TextColor), new FormattedLineSegment("   +MMMh .MMMN`", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-          `sMMMN    ", logger.TextColor), new FormattedLineSegment("   dMMM/ sMMMy ", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM- .sMMMMMMMMMMMMd    ", logger.TextColor), new FormattedLineSegment("  -MMMN  NMMM: ", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-   `sNMMMMMMMdo`    ", logger.TextColor), new FormattedLineSegment("  sMMMy :MMMm  ", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-     `oNMMMMy-      ", logger.TextColor), new FormattedLineSegment("  NMMM- yMMMo  ", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-       `oNMMMMh-    ", logger.TextColor), new FormattedLineSegment(" :MMMm `MMMM.  ", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-         `+mMMMMh:  ", logger.TextColor), new FormattedLineSegment(" yMMMo /MMMd   ", logger.ColorRed) }
                },
                new FormattedLine()
                {
                    Segments = new [] { new FormattedLineSegment("MMMM-            /mMMMMd:", logger.TextColor), new FormattedLineSegment("`MMMM. dMMM+   ", logger.ColorRed) }
                },
            };

            WriteLinesCentered(proxy, lines);
            proxy.Write("\n");
            PrintCoreVersion(proxy, logger);
            proxy.Write("\n\n");
        }
コード例 #3
0
        /// <summary>
        ///     Instructs the renderer to render a clear line from the current position to the end of the window overwriting
        ///     anything in its way.
        /// </summary>
        /// <param name="proxy">The proxy to render to.</param>
        /// <param name="arg">The object to render.</param>
        /// <param name="culture">The culture to use for the render.</param>
        public override void Render(IConsoleProxy proxy, object arg, CultureInfo culture)
        {
            proxy.GetPosition(out var consoleProxy);
            var count = Math.Max(proxy.WindowWidth - consoleProxy.Left, 0);

            proxy.Write(new string(' ', count));
        }
コード例 #4
0
        /// <summary>
        ///     Instructs the renderer to render to the supplied proxy.
        /// </summary>
        /// <param name="proxy">The proxy to render to.</param>
        /// <param name="arg">The object to render.</param>
        /// <param name="culture">The culture to use for the render.</param>
        public override void Render(IConsoleProxy proxy, object arg, CultureInfo culture)
        {
            proxy.GetPosition(out var consoleProxy);
            if (consoleProxy.Left != 0)
            {
                proxy.WriteLine();
            }

            proxy.Write(new string('-', proxy.WindowWidth));
        }
コード例 #5
0
 /// <summary>
 ///     Instructs the renderer to render to the supplied proxy.
 /// </summary>
 /// <param name="proxy">The proxy to render to.</param>
 /// <param name="arg">The object to render.</param>
 /// <param name="culture">The culture to use for the render.</param>
 public override void Render(IConsoleProxy proxy, object arg, CultureInfo culture)
 {
     proxy.Write(this.value);
 }