Esempio n. 1
0
 public void Subscribe(ClassWithDelegate cwd)
 {
     // TODO: Subscribe the OnReturnInt event in the ClassWithDelegate object.
     cwd.OnReturnInt += new ClassWithDelegate.DelegateThatReturnsInt(Doubler);
 }
Esempio n. 2
0
    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();
    }
Esempio n. 3
0
 public void Subscribe(ClassWithDelegate cwd)
 {
     // TODO: Subscribe the OnReturnInt event in the ClassWithDelegate object.
 }