public void Detach() { _list.Changed -= new ChangedEventHandler(ListChanged); _list = null; }
static void Main() { ListWithCahngedEvent list = new ListWithCahngedEvent(); EventListener listener = new EventListener(list); list.Add("obj1"); list.Add("obj2"); }
public EventListener(ListWithCahngedEvent list) { _list = list; _list.Changed += new ChangedEventHandler(ListChanged); }