示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Inserisci la frase che andrà nel div");
            string input = Console.ReadLine();

            Console.BackgroundColor = Styling.Instance().BackgroundColor;
            Console.ForegroundColor = Styling.Instance().ConsoleColor;
            Console.WriteLine($"<div>{input}</div>");
        }
        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!");
            }
        }
 public static Styling Instance()
 {
     if (styling == null)
     {
         lock (TrafficLight)
         {
             if (styling == null)
             {
                 styling = new Styling(ConsoleColor.Red, ConsoleColor.Blue);
             }
         }
     }
     return(styling);
 }