Пример #1
0
        static void Main(string[] args)
        {
            //use switch statement to determine file type or get input parameter

            var sourceUrl = @"C:\lorem.txt";
            var outputUrl = @"C:\output.csv";
            //assume we chose .txt for src and .csv for output file types
            InputFile  src    = new InputFile(sourceUrl, new TextContentHandler());
            OutputFile output = new OutputFile(outputUrl, new CSVContentHandler());

            //test swapping file types
            //IInputFile src = new InputFile(sourceUrl, new CSVContentHandler());
            //IOutputFile output = new OutputFile(outputUrl, new TextContentHandler());

            CounterManager mgr = new CounterManager(src, output);

            try
            {
                mgr.HandleCount();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.ReadLine();
        }