Ejemplo n.º 1
0
 private async Task ProcessFile(string path, IFileTransform transformation)
 {
     try
     {
         if (await transformation.Process(path))
         {
             transformation.Success(path);
         }
         else
         {
             transformation.Failed(path);
         }
     }
     catch (Exception error)
     {
         _logger.Error(error);
         transformation.Failed(path);
     }
 }
Ejemplo n.º 2
0
 public async Task Transform(string root, IFileTransform transformation)
 {
     var walker = new FileFinder(_fileSystem);
     var tasks  = walker.Walk(root, transformation.Matches).Select(path => ProcessFile(path, transformation)).ToList();
     await Task.WhenAll(tasks);
 }