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

            instance.TestEvent += EventHandler;

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

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

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

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

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

            instance.InvokeEvent();
        }