예제 #1
0
        //restore from specified xml
        private void restoreButton_Click(object sender, EventArgs e)
        {
            bool cleanRestore = cleanRadioButton.Checked;
            if (cleanRestore)
            {
                //warn user of db deletion
                DialogResult shouldClean = MessageBox.Show("All existing data in the database will be deleted.\r\nAre you sure you want to continue?", "Clean restore", MessageBoxButtons.YesNo);
                if (shouldClean != DialogResult.Yes)
                    return;
            }

            using (Conf_RestoreDlg dlg = new Conf_RestoreDlg(restorePathTextBox.Text, false))
            {
                dlg.CleanRestore = cleanRestore;
                dlg.EmulatorMergeType = ((BackupDropdownItem)emuMergeComboBox.SelectedItem).ValueMember;
                dlg.GameMergeType = ((BackupDropdownItem)gameMergeComboBox.SelectedItem).ValueMember;
                dlg.RestoreThumbs = restoreThumbsCheckBox.Checked;
                //display dialog (starts restore)
                if (dlg.ShowDialog() == DialogResult.OK)
                    MessageBox.Show("Restore completed successfully.");
            }
        }
예제 #2
0
 //display dialog and start db backup
 private void backupButton_Click(object sender, EventArgs e)
 {
     using (Conf_RestoreDlg dlg = new Conf_RestoreDlg(backupPathTextBox.Text, true))
     {
         dlg.BackupThumbs = backupThumbsCheckBox.Checked;
         if (dlg.ShowDialog() == DialogResult.OK)
             MessageBox.Show("Backup completed successfully.");
     }
 }