Esempio n. 1
0
        protected void PrintMessage(Msg msg)
        {
            string       level = "";
            ConsoleColor color = ConsoleColor.Gray;

            if (msg.Level == Msg.LEVEL.DEBUG)
            {
                color = ConsoleColor.Cyan;
                level = "DBG";
            }
            else if (msg.Level == Msg.LEVEL.INFO)
            {
                color = ConsoleColor.Blue;
                level = "INF";
            }
            else if (msg.Level == Msg.LEVEL.WARN)
            {
                color = ConsoleColor.Yellow;
                level = "WRN";
            }
            else if (msg.Level == Msg.LEVEL.ERROR)
            {
                color = ConsoleColor.Red;
                level = "ERR";
            }
            else if (msg.Level == Msg.LEVEL.SUCCESS)
            {
                color = ConsoleColor.Green;
                level = "SUC";
            }

            CoEx.SetColor(null, color);
            CoEx.Write("[{0}] ", level);
            CoEx.ResetColor();

            CoEx.WriteLine(msg.ToString());
        }
Esempio n. 2
0
 public void ApplyBackground()
 {
     CoEx.SetColor(this.Background, null);
 }
Esempio n. 3
0
 public void Apply()
 {
     CoEx.SetColor(this.Background, this.Foreground);
 }
Esempio n. 4
0
 public void ApplyForeground()
 {
     CoEx.SetColor(null, this.Foreground);
 }