Esempio n. 1
0
 private static void ProcessFiles(Object stateInfo)
 {
     foreach (var filename in FilesToProcess.Keys) //May not be in order of adding
     {
         if (FilesToProcess.TryRemove(filename, out _))
         {
             var fileProcessor = new FileProcessor(filename);
             fileProcessor.Process();
         }
     }
 }
Esempio n. 2
0
        private static void ProcessDirectory(string directoryPath, string fileType)
        {
            //var allFiles = Directory.GetFiles(directoryPath);
            switch (fileType)
            {
            case "TEXT":
                string[] textFiles = Directory.GetFiles(directoryPath, "*.txt");
                foreach (var textFilePath in textFiles)
                {
                    var fileProcessor = new FileProcessor(textFilePath);
                    fileProcessor.Process();
                }
                break;

            default:
                Console.WriteLine($"Error: {fileType} is not supported");
                return;
            }
        }
Esempio n. 3
0
        private static void ProcessSingleFile(string filePath)
        {
            var fileProcessor = new FileProcessor(filePath);

            fileProcessor.Process();
        }