Exemplo n.º 1
0
 public void Init(IExecutionContext context, List<string> oldFilePaths)
 {
     foreach (var oldFilePath in oldFilePaths)
     {
         FilesPair pair = new FilesPair();
         pair.SourceFilePath = oldFilePath;
         if (File.Exists(oldFilePath))
         {
             string rollbackFileName = Guid.NewGuid().ToString("N") + ".rlb";
             string dataPath = GetPath(context.ExecutedPackage.TransactionsPath);
             string rollbackFilePath = Path.Combine(dataPath, rollbackFileName);
             pair.BackupFilePath = rollbackFilePath;
             File.Copy(oldFilePath, rollbackFilePath);
         }
         Files.Add(pair);
     }
 }
Exemplo n.º 2
0
 public void Init(IExecutionContext context, List <string> oldFilePaths)
 {
     foreach (var oldFilePath in oldFilePaths)
     {
         FilesPair pair = new FilesPair();
         pair.SourceFilePath = oldFilePath;
         if (File.Exists(oldFilePath))
         {
             string rollbackFileName = Guid.NewGuid().ToString("N") + ".rlb";
             string dataPath         = GetPath(context.ExecutedPackage.TransactionsPath);
             string rollbackFilePath = Path.Combine(dataPath, rollbackFileName);
             pair.BackupFilePath = rollbackFilePath;
             File.Copy(oldFilePath, rollbackFilePath);
         }
         Files.Add(pair);
     }
 }