public void Run() { while (true) { Thread.Sleep(1000); if (this.seconds == 0) { TimeEventArg ti = new TimeEventArg(this.seconds, this.message); if (TimePassed != null) { Console.WriteLine(this.seconds); TimePassed(this, ti); } break; } Console.WriteLine(this.seconds); seconds--; } }
private void Alarm_TimePassed(object alarm, TimeEventArg tiInformation) { Console.WriteLine("\nCUENTA REGRESIVA CONCLUIDA!\n" + tiInformation.message); }