示例#1
0
文件: Program.cs 项目: 745322878/Code
 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
        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);
        }
示例#3
0
文件: Program.cs 项目: xiyouWyz/Code
        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();
        }
示例#4
0
文件: Program.cs 项目: Meowv/DotNet
        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();
        }
示例#5
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();
        }
示例#6
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();
        }