Esempio n. 1
0
        static void Main(string[] args)
        {
            // create a new list
            ListWithChangedEvent list = new ListWithChangedEvent();
            // create a class that litens for when the list is changed
            EventListener listener = new EventListener(list);

            list.Add("hello");
            list.Add("world");
            list.Clear();
            listener.Detatch();

            Console.ReadKey();
        }
Esempio n. 2
0
 public EventListener(ListWithChangedEvent list)
 {
     List          = list;
     List.Changed += new ChangeEventHandler(OnListChanged);
 }