Exemple #1
0
        static void Main(string[] args)
        {
            Alarmclock alarmclock = new Alarmclock();
            Student    student    = new Student();

            student.Register(alarmclock);


            if (DateTime.Now.Hour == 6)
            {
                alarmclock.OnSendMessage();
            }
        }
Exemple #2
0
        public void Register(Alarmclock e)
        {
            Alarmclock alarmclock = new Alarmclock();

            alarmclock.SendMessage += new AlarmclockEventHandler(HandlerEvent);
        }