Ejemplo n.º 1
0
        static void RunAsyncDelegate()
        {
            AsyncDelegate tmpClass = new AsyncDelegate();

            AsyncDelegate.FirstSubscriber fst = new AsyncDelegate.FirstSubscriber();
            fst.Subscribe(tmpClass);
            AsyncDelegate.SecondSubscriber scd = new AsyncDelegate.SecondSubscriber();
            //scd.Subscribe (tmpClass);
            int result = tmpClass.returnIntDelegate();

            Console.WriteLine("result = {0}", result);
            result = tmpClass.returnIntDelegate();
            Console.WriteLine("result = {0}", result);
            result = tmpClass.returnIntDelegate();
            Console.WriteLine("result = {0}", result);

            tmpClass.Run();
        }