Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Teacher          teacherChen = new Teacher();
            TeacherEventArgs tea         = new TeacherEventArgs();

            teacherChen.teacherEventArgs         = tea;
            teacherChen.teacherEventArgs.ForWhat = "EXAM";
            Student stu1 = new Student();
            Student stu2 = new Student();

            teacherChen.TeacherComing += stu1.OnTeachercoming;
            teacherChen.TeacherComing += stu2.OnTeachercoming;

            teacherChen.TeacherRun();
            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public void OnTeachercoming(object o, TeacherEventArgs e)
 {
     Console.WriteLine("Stop Watching Cellphone");
     Console.WriteLine("Begin Reading");
     Console.WriteLine("Teacher:\"I'm coming for " + e.ForWhat + " \"");
 }