public static void Main() { ClassWithDelegate theClasWithDelegate = new ClassWithDelegate(); FirstSubscriber fs = new FirstSubscriber(); fs.SUbscribe(theClasWithDelegate); SecondSubscriber ss = new SecondSubscriber(); ss.SUbscribe(theClasWithDelegate); theClasWithDelegate.Run(); }
public void SUbscribe(ClassWithDelegate theClasWithDelegate) { theClasWithDelegate.theDelegate += new ClassWithDelegate.DelegateThatReturnInt(Doubler); }