public Professor(Student student) { _student = student; _student.startedWork += StartedWork; _student.working += Working; _student.finishedWorking += FinishedWorking; }
static void Main(string[] args) { Student Jim = new Student(); using (Professor Breedlove = new Professor(Jim)) using (Spouse Sally = new Spouse(Jim)) { Jim.DoWork(); //Jim.finishedWorking(); } }
public Spouse(Student student) { _student = student; _student.startedWork += StartedWork; _student.finishedWorking += FinishedWorking; }