Example #1
0
 public void Detatch()
 {
     _evList.ChangedEventHandler -= new ListWithChangedEvent.ChangeEventHandler(ListChanged);
     _evList = null;
 }
Example #2
0
        public static void run()
        {
            ListWithChangedEvent evList = new ListWithChangedEvent();
            EventListener listener = new EventListener(evList);

            evList.Add("hello");
            evList.Clear();
            evList.Add("world");
            evList[0] = 'W';
            listener.Detatch();
        }
Example #3
0
 public EventListener(ListWithChangedEvent elist)
 {
     _evList = elist;
     _evList.ChangedEventHandler += new ListWithChangedEvent.ChangeEventHandler(ListChanged);
 }