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(); }
private void Print(object sender, EventArgs e) { List.Print(); }