public SecondClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick2) : base(originalColumn, originalRow, color) { //Data Members _ticker2 = tick2; tick2.OnTenthsTick += TenthSecond; }
public ThirdClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick3) : base(originalColumn, originalRow, color) { //Data Members _ticker3 = tick3; tick3.OnHundrethsTick += HundredthSecond; }
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(); } }
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(); } }
public TenthSecondClock(int originalColumn, int originalRow, ConsoleColor?color, Ticker ticker) : base(originalColumn, originalRow, color) { _ticker = ticker; _ticker.OnTenthsTick += TenthSecond; }
public TenthSecondClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick) : base(originalColumn, originalRow, color) { _ticker = tick; _ticker.OnTenthsTick += TenthSecond; }
public FirstClock(int originalColumn, int originalRow, ConsoleColor? color, Ticker tick1) : base(originalColumn, originalRow, color) { _ticker = tick1; tick1.OnSecondsTick += Second; }