Ejemplo n.º 1
0
 public void AddNewItem1(FileSystemEventArgs e, DataItems items, IDataSerializer dataSerializer, string targetFolder)
 {
     try
     {
         string sourceFilePath = e.FullPath;
         //string archiveName = FileCompressor.GetArchiveFileName(e.FullPath);
         string fileName     = Path.GetFileName(sourceFilePath);
         string destFilePath = targetFolder;
         Task.Run(
             () =>
         {
             if (FileMover.Move(sourceFilePath, destFilePath))
             {
                 FileCompressor.Compress(destFilePath);
                 dataSerializer.Store(items);
             }
         }
             );
     }
     catch (Exception ex)
     {
         _log.Error(ex);
     }
 }