private static void ProcessFile(CacheEntryRemovedArguments arguments) { Console.WriteLine($"Cache item removed : {arguments.CacheItem.Key}, become {arguments.RemovedReason}"); if (arguments.RemovedReason == CacheEntryRemovedReason.Expired) { var fileProcessor = new FileProcessor(arguments.CacheItem.Key); fileProcessor.Process(); } else { Console.WriteLine($"Warning, {arguments.CacheItem.Key} was removed unexpectable"); } }
private static void ProcessDirectory(string dirPath, string filePath) { switch (filePath) { case "TXT": { string[] textFiles = Directory.GetFiles(dirPath, "*.txt"); foreach (var textFilePath in Directory.GetFiles(dirPath)) { var fileProcessor = new FileProcessor(textFilePath); fileProcessor.Process(); } } break; default: Console.WriteLine(); break; } }
private static void ProcessSingleFile(string filePath) { FileProcessor fileProcessor = new FileProcessor(filePath); fileProcessor.Process(); }