public void Subscribe(ClassWithDelegate cwd) { // TODO: Subscribe the OnReturnInt event in the ClassWithDelegate object. cwd.OnReturnInt += new ClassWithDelegate.DelegateThatReturnsInt(Doubler); }
static void Main() { // TODO: Create an object of type ClassWithDelegate. ClassWithDelegate cwd = new ClassWithDelegate(); // TODO: Create a FirstSubscriber object and call its Subscribe method. FirstSubscriber fs = new FirstSubscriber(); fs.Subscribe(cwd); // TODO: Create a SecondSubscriber object and call its Subscribe method. SecondSubscriber ss = new SecondSubscriber(); ss.Subscribe(cwd); // TODO: Call the Run method in the ClassWithDelegate class. cwd.Run(); }
public void Subscribe(ClassWithDelegate cwd) { // TODO: Subscribe the OnReturnInt event in the ClassWithDelegate object. }