Пример #1
0
 private IEnumerable <JobItemFile> PrepareJobScope(IEnumerable <string> inputs,
                                                   string[] filters, IEnumerable <MacroData> macros)
 {
     foreach (var input in inputs)
     {
         if (Directory.Exists(input))
         {
             foreach (var file in Directory.EnumerateFiles(input, "*.*", SearchOption.AllDirectories))
             {
                 if (MatchesFilter(file, filters))
                 {
                     if (m_AppProvider.CanProcessFile(file))
                     {
                         yield return(new JobItemFile(file, macros.Select(m => new JobItemMacro(m)).ToArray()));
                     }
                     else
                     {
                         m_UserLogger.WriteLine($"Skipping file '{file}'");
                     }
                 }
             }
         }
         else if (File.Exists(input))
         {
             yield return(new JobItemFile(input, macros.Select(m => new JobItemMacro(m)).ToArray()));
         }
         else
         {
             throw new Exception("Specify input file or directory");
         }
     }
 }