示例#1
0
        public void AddEventHandler3()
        {
            var instance = new ClassWithEvent();

            instance.TestEvent += EventHandler;

            instance.InvokeEvent();
        }
示例#2
0
        public void AddEventHandler1()
        {
            var instance = new ClassWithEvent();

            instance.TestEvent += () => Tracker.Call("hello");

            instance.InvokeEvent();
        }
示例#3
0
        public void RemoveEventHandler4()
        {
            var instance = new ClassWithEvent();

            Tracker.Call("hello1");
            instance.TestEvent += EventHandler;
            instance.TestEvent -= EventHandler;
            instance.InvokeEvent();
        }
示例#4
0
        public void AddEventHandler2()
        {
            var instance = new ClassWithEvent();

            instance.TestEvent += delegate
            {
                Tracker.Call("hello");
            };

            instance.InvokeEvent();
        }
示例#5
0
        public void AddEventHandler4()
        {
            ClassWithEvent.StaticEvent += EventHandler;

            ClassWithEvent.InvokeStaticEvent();
        }