Esempio n. 1
0
        public void Tick()
        {
            this.M++;
            MyEventHendler args = new MyEventHendler();

            args.Massege = $"Its time to wake up! {this.H}/{this.M}";
            TimeToWakeUp(args);
        }
Esempio n. 2
0
        protected virtual void TimeToWakeUp(MyEventHendler e)
        {
            EventHandler <MyEventHendler> handler = AlarmClock;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Esempio n. 3
0
        public void TornOf()
        {
            this.H = 0;
            this.M = 0;
            MyEventHendler args = new MyEventHendler();

            args.Massege = $"The alarm clock is torn off";
            TimeToWakeUp(args);
        }
Esempio n. 4
0
 static void c_TimeTowakeUp(object o, MyEventHendler e)
 {
     Console.WriteLine(e.Massege);
     Environment.Exit(0);
 }