Exemplo n.º 1
0
        public static void runMyEventDemoandMyEvent()
        {
            Myevent evnt = new Myevent();

            evnt.SomeEvent += Handler; //Adding Handler() to the event list
            evnt.OnSomeEvent();        //Firing the event
        }
Exemplo n.º 2
0
        public event MyeventHandler SomeEvent; //see defeinition of
                                               // "event"by right clicking
        // this will fire the event
        public void OnSomeEvent()
        {
            Myevent evt = new Myevent();

            if (SomeEvent != null)//make sure there is some method to execute
            {
                SomeEvent(this, evt);
            }
        }