예제 #1
0
        public static void Main()
        {
            ClassWithDelegate theClasWithDelegate = new ClassWithDelegate();

            FirstSubscriber fs = new FirstSubscriber();

            fs.SUbscribe(theClasWithDelegate);

            SecondSubscriber ss = new SecondSubscriber();

            ss.SUbscribe(theClasWithDelegate);

            theClasWithDelegate.Run();
        }
예제 #2
0
 public void SUbscribe(ClassWithDelegate theClasWithDelegate)
 {
     theClasWithDelegate.theDelegate += new ClassWithDelegate.DelegateThatReturnInt(Doubler);
 }