Example #1
0
 internal void Commit()
 {
     if (File.Exists(Tempory))
     {
         WhileTry.Try(() =>
         {
             return(MoveTemporyToTarget());
         }, TryCount, true, "Commit : Temp move to target fail..");
     }
 }
Example #2
0
 internal void Rollback()
 {
     if (File.Exists(Backup))
     {
         WhileTry.Try(() =>
         {
             return(MoveBackupToTarget());
         }, TryCount, true, "Rollback : Backup move to target fail..");
     }
 }
Example #3
0
        internal void BeginOperation()
        {
            string name         = NameWithoutExtension;
            string ticks        = DateTime.Now.Ticks.ToString();
            string operationStr = "None";

            Tempory = Path.Combine(DirectoryName, "Temp", $"Temp.{name}.{operationStr}.{ticks}.json");
            Backup  = Path.Combine(DirectoryName, "Backup", $"Backup.{name}.{operationStr}.{ticks}.json");

            CheckDirectories();

            WhileTry.Try(() =>
            {
                return(CreateTargetBackup());
            }, TryCount, true, $"Failed to create Target file backup typeOf: {TypeOf}");
        }