public void Detatch() { _evList.ChangedEventHandler -= new ListWithChangedEvent.ChangeEventHandler(ListChanged); _evList = null; }
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(); }
public EventListener(ListWithChangedEvent elist) { _evList = elist; _evList.ChangedEventHandler += new ListWithChangedEvent.ChangeEventHandler(ListChanged); }