コード例 #1
0
        public static void CheckCurrentSave()
        {
            DateTime saveTime = File.GetLastWriteTime(IsaacSave);
            ObservableCollection <IsaacArchive> archives = GetArchiveList();

            if (archives == null)
            {
                ArchiveCurrentSave(saveTime.ToString("yyyyMMdd-hhmmss"));
                return;
            }

            IsaacArchive lastArchive = archives[0];

            if (saveTime > lastArchive.SaveDate)
            {
                ArchiveCurrentSave(saveTime.ToString("yyyyMMdd-hhmmss"));
            }
            //else
            //Console.WriteLine("Archives current.");
        }
コード例 #2
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            IsaacArchive archive = obj as IsaacArchive;

            if (this.SaveDate > archive.SaveDate)
            {
                return(-1);
            }
            else if (this.SaveDate < archive.SaveDate)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
コード例 #3
0
        public static void RestoreArchivedSave(IsaacArchive archive)
        {
            //Console.WriteLine("Restoring archived save " + archive.Name);
            string serial = Path.Combine(IsaacDirectory, "serial.txt");

            if (File.Exists(IsaacSave))
            {
                File.Delete(IsaacSave);
            }
            if (File.Exists(serial))
            {
                File.Delete(serial);
            }

            File.Copy(Path.Combine(archive.Location, "so.sol"), IsaacSave);
            File.Copy(Path.Combine(archive.Location, "serial.txt"), serial);

            if (File.Exists(ArchiveText))
            {
                File.Delete(ArchiveText);
            }
            File.WriteAllText(ArchiveText, archive.Name);
        }
コード例 #4
0
        public static void RestoreArchivedSave(IsaacArchive archive)
        {
            //Console.WriteLine("Restoring archived save " + archive.Name);
            string serial = Path.Combine(IsaacDirectory, "serial.txt");

            if (File.Exists(IsaacSave))
                File.Delete(IsaacSave);
            if (File.Exists(serial))
                File.Delete(serial);

            File.Copy(Path.Combine(archive.Location, "so.sol"), IsaacSave);
            File.Copy(Path.Combine(archive.Location, "serial.txt"), serial);

            if (File.Exists(ArchiveText))
                File.Delete(ArchiveText);
            File.WriteAllText(ArchiveText, archive.Name);
        }
コード例 #5
0
 public static void RenameArchive(IsaacArchive archive, string name)
 {
     Directory.Move(archive.Location, Path.Combine(Archives, name));
 }
コード例 #6
0
 public static void DeleteArchive(IsaacArchive archive)
 {
     Directory.Delete(archive.Location, true);
 }
コード例 #7
0
 public static void DeleteArchive(IsaacArchive archive)
 {
     Directory.Delete(archive.Location, true);
 }
コード例 #8
0
 public static void RenameArchive(IsaacArchive archive, string name)
 {
     Directory.Move(archive.Location, Path.Combine(Archives, name));
 }