Esempio n. 1
0
 public SecondClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick2)
     : base(originalColumn, originalRow, color)
 {
     //Data Members
     _ticker2 = tick2;
    
     tick2.OnTenthsTick += TenthSecond;
 }
Esempio n. 2
0
         public ThirdClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick3)
         : base(originalColumn, originalRow, color)
         {
                //Data Members
                _ticker3 = tick3;
               
                tick3.OnHundrethsTick += HundredthSecond;

         }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.CursorVisible = false;

            Ticker ticker= new Ticker();

            using (FirstClock clock1 = new FirstClock(0, 1, ConsoleColor.Yellow, ticker))
           // using (SecondClock clock2 = new SecondClock(0, 2, ConsoleColor.Green, ticker))
            using (ThirdClock clock3 = new ThirdClock(0, 3, ConsoleColor.Red, ticker))
            {
                Thread thread = new Thread(ticker.Run);
                thread.Start();
                Console.ReadLine();
                ticker.Done = true;
                thread.Join();
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            Ticker ticker = new Ticker();

            using (SecondClock clock1 = new SecondClock(0, 1, ConsoleColor.Green, ticker))
            using (TenthSecondClock clock2 = new TenthSecondClock(0, 2, ConsoleColor.Magenta, ticker))
            using (HundredthSecondClock clock3 = new HundredthSecondClock(0, 3, ConsoleColor.Red, ticker))
            {
                Thread thread = new Thread(ticker.Run);
                thread.Start();

                Console.ReadLine();

                ticker.Done = true;
                thread.Join();
            }
        }
Esempio n. 5
0
 public TenthSecondClock(int originalColumn, int originalRow, ConsoleColor?color, Ticker ticker)
     : base(originalColumn, originalRow, color)
 {
     _ticker = ticker;
     _ticker.OnTenthsTick += TenthSecond;
 }
Esempio n. 6
0
 public TenthSecondClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick)
     : base(originalColumn, originalRow, color)
 {
     _ticker = tick;
     _ticker.OnTenthsTick += TenthSecond;
 }
Esempio n. 7
0
 public FirstClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick1)
     : base(originalColumn, originalRow, color)
 {
     _ticker = tick1;
     tick1.OnSecondsTick += Second;
 }