Exemplo n.º 1
0
 public MainWindowViewModel()
 {
     Archives = (ObservableCollection <IsaacArchive>)SaveDataAccess.GetArchiveList();
     if (Archives != null && Archives.Count > 0)
     {
         Archive = Archives[0];
     }
     RaisePropertyChanged("Archive");
     RaisePropertyChanged("Archives");
 }
Exemplo n.º 2
0
        public void RestoreSlot()
        {
            MessageBoxResult confirm = MessageBox.Show("Are you sure you want to overwrite your current save?", "Confirm overwrite", MessageBoxButton.YesNo);

            if (confirm == MessageBoxResult.Yes)
            {
                SaveDataAccess.RestoreArchivedSave(Archive);
                Archives = SaveDataAccess.GetArchiveList();
                RaisePropertyChanged("LastArchive");
            }
        }
Exemplo n.º 3
0
        public void DeleteSlot()
        {
            MessageBoxResult confirm = MessageBox.Show("Are you sure you want to delete this slot?", "Confirm deletion", MessageBoxButton.YesNo);

            if (confirm == MessageBoxResult.Yes)
            {
                SaveDataAccess.DeleteArchive(Archive);
                Archives = SaveDataAccess.GetArchiveList();
                RaisePropertyChanged("Archives");
            }
        }
Exemplo n.º 4
0
        public void SaveToSlot()
        {
            MessageBoxResult confirm = MessageBox.Show("Are you sure you want to overwrite this archived save?", "Confirm overwrite", MessageBoxButton.YesNo);

            if (confirm == MessageBoxResult.Yes)
            {
                SaveDataAccess.ArchiveCurrentSave(Archive.Name);
                Archives = SaveDataAccess.GetArchiveList();
                RaisePropertyChanged("Archives");
                RaisePropertyChanged("LastArchive");
            }
        }
Exemplo n.º 5
0
        public string ParseLastUsedArchive()
        {
            string lastArchive = SaveDataAccess.CheckLastUsedArchive();

            if (lastArchive == null)
            {
                return("You should archive your save.");
            }
            else
            {
                return("The most recently used slot is " + lastArchive);
            }
        }
Exemplo n.º 6
0
        public void SaveNewSlot()
        {
            TextEntryWindow nameSlot = new TextEntryWindow();

            nameSlot.ShowDialog();
            string name = ((TextEntryWindowViewModel)nameSlot.DataContext).Name;

            if (name != null)
            {
                SaveDataAccess.ArchiveCurrentSave(name);
                Archives = SaveDataAccess.GetArchiveList();
                RaisePropertyChanged("Archives");
                RaisePropertyChanged("LastArchive");
            }
        }
Exemplo n.º 7
0
        public void RenameSlot()
        {
            TextEntryWindow rename = new TextEntryWindow();

            rename.ShowDialog();
            string name = ((TextEntryWindowViewModel)rename.DataContext).Name;

            if (name != null)
            {
                SaveDataAccess.RenameArchive(Archive, name);
                Archives = SaveDataAccess.GetArchiveList();
                RaisePropertyChanged("Archives");
                RaisePropertyChanged("LastArchive");
            }
        }