Example #1
0
        // Test the ListWithChangedEvent class.
        public static void Main()
        {
            TextDataProvider textReader = new TextDataProvider();

            // Add event listener.
            textReader.ReadEvent += new ReadEventHandler(TextReader_ReadEvent);

            Console.WriteLine("First TEST");
            Console.WriteLine(textReader.Read("EventTask.txt"));

            // detach event listener.
            textReader.ReadEvent -= new ReadEventHandler(TextReader_ReadEvent);

            // Add new event listener.
            textReader.ReadEvent += new ReadEventHandler(EventCount);

            Console.WriteLine("\nSecond TEST");
            Console.WriteLine(textReader.Read("EventTask.txt"));
        }
        // Test the ListWithChangedEvent class.
        public static void Main()
        {
            TextDataProvider textReader = new TextDataProvider();

            // Add event listener.
            textReader.ReadEvent += new ReadEventHandler(TextReader_ReadEvent);

            Console.WriteLine("First TEST");
            Console.WriteLine(textReader.Read("EventTask.txt"));

            // detach event listener.
            textReader.ReadEvent -= new ReadEventHandler(TextReader_ReadEvent);

            // Add new event listener.
            textReader.ReadEvent += new ReadEventHandler(EventCount);

            Console.WriteLine("\nSecond TEST");
            Console.WriteLine(textReader.Read("EventTask.txt"));
        }