Example #1
0
        public static void WriteStackTrace(string trace)
        {
            ConsoleColor foregroundColor = Console.ForegroundColor;

            Console.WriteLine();
            Console.ForegroundColor = (ConsoleColor)Theme[ConsoleThemeColor.ErrorColor2];
            Console.WriteLine(new string(ConsoleChars.GetShade(ConsoleShade.Dim), BufferWidth));
            Console.ForegroundColor = (ConsoleColor)Theme[ConsoleThemeColor.TitleText];
            Console.WriteLine("  " + trace.Replace("\n", "\n  "));
            Console.WriteLine();
            Console.ForegroundColor = (ConsoleColor)Theme[ConsoleThemeColor.ErrorColor2];
            Console.WriteLine(new string(ConsoleChars.GetShade(ConsoleShade.Dim), BufferWidth));
            Console.WriteLine();
            Console.ForegroundColor = foregroundColor;
        }
Example #2
0
 public static void WriteLogo(int x, int y, int pixWidth, int pixHeight, ConsoleShade fillShade, ConsoleShade endShade, ConsoleShade shadowShade, string[] lines)
 {
     if (RugConsole.CanManipulateBuffer)
     {
         ConsoleColorState colorState = RugConsole.ColorState;
         int    cursorLeft            = RugConsole.CursorLeft;
         int    cursorTop             = RugConsole.CursorTop;
         string str  = new string(ConsoleChars.GetShade(fillShade), pixWidth);
         string str2 = "";
         if (pixWidth > 1)
         {
             str2 = new string(ConsoleChars.GetShade(fillShade), pixWidth - 1) + ConsoleChars.GetShade(endShade);
         }
         else
         {
             str2 = new string(ConsoleChars.GetShade(endShade), 1);
         }
         string str3 = new string(ConsoleChars.GetShade(ConsoleShade.Clear), pixWidth);
         string str4 = new string(ConsoleChars.GetShade(shadowShade), pixWidth);
         string str5 = "";
         if (pixWidth > 1)
         {
             str5 = new string(ConsoleChars.GetShade(shadowShade), 1) + new string(ConsoleChars.GetShade(ConsoleShade.Clear), pixWidth - 1);
         }
         else
         {
             str5 = new string(ConsoleChars.GetShade(shadowShade), 1);
         }
         int num3 = y;
         RugConsole.CursorLeft           = x;
         RugConsole.CursorTop            = num3++;
         RugConsole.ForegroundThemeColor = ConsoleThemeColor.TitleText;
         for (int i = 0; i < lines.Length; i++)
         {
             for (int j = 0; j < pixHeight; j++)
             {
                 RugConsole.Write(string.Format(lines[i], new object[] { str, str2, str3, str4, str5 }));
                 RugConsole.CursorLeft = x;
                 RugConsole.CursorTop  = num3++;
             }
         }
         RugConsole.ColorState = colorState;
         RugConsole.CursorTop  = cursorTop;
         RugConsole.CursorLeft = cursorLeft;
     }
 }