Пример #1
0
 static void Main(string[] args)
 {
     var e = new EventTest(5);
     e.SetValue(100);
     e.ChangeNum += new EventTest.NumManipulationHandler(EventTest.EventFired);
     e.SetValue(200);
     Console.ReadLine();
 }
Пример #2
0
        static void Main(string[] args)
        {
            EventTest et = new EventTest();

            et.Setvalue(10);
            et.ChangeNum += new EventTest.NumManidpulationHandler(EventTest.EventFired);
            et.Setvalue(100);
        }
Пример #3
0
        public static void Main()
        {
            EventTest     e = new EventTest();
            subscribEvent v = new subscribEvent();

            e.ChangeNum += new EventTest.NumManipulationHandler(v.printf);
            e.SetValue(7);
            e.SetValue(11);
        }
Пример #4
0
        static void Main(string[] args)
        {
            var e = new EventTest(5);

            e.SetValue(100);
            e.ChangeNum += new EventTest.NumManipulationHandler(EventTest.EventFired);
            e.SetValue(200);
            Console.ReadLine();
        }
Пример #5
0
        static void Main(string[] args)
        {
            var e = new EventTest(5);

            e.ChangNum += new EventTest.NumManipulationHandler(EventTest.EventFired);
            e.Setvalue(50);
            //e.Setvalue(100);

            I i = new Myclass();

            i.MyEvent += new MyDelegate(f);
            i.FireAway();
            Console.WriteLine();
        }
Пример #6
0
        static void Main(string[] args)
        {
            //EventHandler

            var e = new EventTest(5);

            e.SetValue(100);
            e.ChangeNum += new EventTest.NumManupulationHandler(EventTest.EventFired);
            e.SetValue(200);

            I i = new Myclass();

            i.MyEvent += new MyDelegate(f);
            i.FireAway();
        }
Пример #7
0
        static void Main(string[] args)
        {
            var e = new EventTest(5);

            e.SetValue(10);
            e.ChangeNum +=
                new EventTest.NumMainipulationHandler(EventTest.EventFired);
            e.SetValue(100);

            Console.WriteLine("------------------------");
            I i = new MyClass();

            i.MyEvent += new MyDelegate(f);
            i.FireAway();

            Console.ReadLine();
        }
Пример #8
0
        static void Main(string[] args)
        {
            var e = new EventTest(5);

            e.SetValue(100);
            e.ChangeNum += new EventTest.NumManipulationHandler(EventTest.EventFired); //透過方法傳給委託然後綁定到event上面
            e.SetValue(200);
            e.SetValue(100);
            e.SetValue(200);
            e.SetValue(100);

            I i = new MyClass();

            i.MyEvent += new MyDelegate(f);
            i.FireAway();

            Console.ReadLine();
        }