static void Main(string[] args) { Console.Write("Application Starting"); PublicClass pc = new PublicClass(); TimeSpan alarmTime = new TimeSpan(5, 30, 0); TimeSpan stopAlarm = new TimeSpan(6, 0, 0); AlarmClock clock = new AlarmClock(alarmTime, stopAlarm); clock.Alarm += (sender, e) => pc.Alarm(); }