示例#1
0
        static void Main(string[] args)
        {
            for (int i = 0; i < 100; i++)
            {
                Console.BackgroundColor = Styling.Instance().BackgroundColor;
                Console.ForegroundColor = Styling.Instance().ConsoleColor;

                Console.WriteLine("Hello World!");
            }
        }
示例#2
0
 public static Styling Instance()
 {
     if (styling == null)
     {
         lock (TrafficLight)
         {
             if (styling == null)
             {
                 styling = new Styling(ConsoleColor.Red, ConsoleColor.Blue);
             }
         }
     }
     return(styling);
 }