Exemplo n.º 1
0
        static void Main()
        {
            var dataReader = new FileDataReader();
            var monitoredExtension = new MonitoredDataReaderExtension(dataReader, null);
            var authorizedExtension = new AuthorizedDataReaderExtension(dataReader, "key123asd", monitoredExtension);

            dataReader.AddExtension(authorizedExtension);

            dataReader.RemoveExtension(typeof(MonitoredDataReaderExtension));

            string[] result = {};
            try
            {
                result = dataReader.ReadData("data.txt");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            foreach (var line in result)
            {
                Console.WriteLine(line);
            }
            Console.Read();
        }