예제 #1
0
        static void Main(string[] args)
        {
            // create a new list
            ListWithChangedEvent list = new ListWithChangedEvent();

            // creeat a class that listens for when the list is changed
            EventListener listener = new EventListener(list);

            list.Print();
            list.FizzBuzz();
            list.Print();


            listener.Detatch();

            Console.ReadKey();
        }
예제 #2
0
 private void Print(object sender, EventArgs e)
 {
     List.Print();
 }