public void Tick() { this.M++; MyEventHendler args = new MyEventHendler(); args.Massege = $"Its time to wake up! {this.H}/{this.M}"; TimeToWakeUp(args); }
protected virtual void TimeToWakeUp(MyEventHendler e) { EventHandler <MyEventHendler> handler = AlarmClock; if (handler != null) { handler(this, e); } }
public void TornOf() { this.H = 0; this.M = 0; MyEventHendler args = new MyEventHendler(); args.Massege = $"The alarm clock is torn off"; TimeToWakeUp(args); }
static void c_TimeTowakeUp(object o, MyEventHendler e) { Console.WriteLine(e.Massege); Environment.Exit(0); }