Beispiel #1
0
 public static void DeleteSave(UserDataStateRelay toDelete)
 {
     try
     {
         Directory.Delete(toDelete.Location, true);
         if (toDelete.Location == ActiveSave?.Location)
         {
             Directory.CreateDirectory(toDelete.Location);
         }
         if (AllBackups.Contains(toDelete))
         {
             AllBackups.Remove(toDelete);
         }
         else if (ActiveSave == toDelete)
         {
             ActiveSave = null;
         }
     }
     catch (IOException ioe)
     {
         Wood.WriteLine($"ERROR DELETING SAVE {toDelete.MyName}:");
         Wood.Indent();
         Wood.WriteLine(ioe);
         Wood.Unindent();
     }
 }
Beispiel #2
0
        public static void StashActiveSave()
        {
            if (!BlepOut.IsMyPathCorrect)
            {
                return;
            }
            UserDataStateRelay udsr = ActiveSave ?? new UserDataStateRelay(UserDataFolder);

            AllBackups.Add(udsr.CloneTo(PathForNewBackup));
        }
Beispiel #3
0
        public static void LoadBackupList()
        {
            bool flag = BlepOut.IsMyPathCorrect;

            if (!Directory.Exists(BackupFolderPath))
            {
                Directory.CreateDirectory(BackupFolderPath);
            }
            if (flag)
            {
                ActiveSave = new UserDataStateRelay(UserDataFolder)
                {
                    CreationTime = DateTime.Now
                };
            }
            AllBackups.Clear();
            foreach (DirectoryInfo dir in new DirectoryInfo(BackupFolderPath).GetDirectories())
            {
                AllBackups.Add(new UserDataStateRelay(dir)
                {
                });
            }
        }