Example #1
0
        //restore from specified xml
        private void restoreButton_Click(object sender, EventArgs e)
        {
            Conf_RestoreDlg dlg;

            if (mergeRadioButton.Checked) //if we're merging
            {
                //get merge settings
                MergeType emuMergeType     = ((BackupDropdownItem)emuMergeComboBox.SelectedItem).ValueMember;
                MergeType profileMergeType = ((BackupDropdownItem)profileMergeComboBox.SelectedItem).ValueMember;
                MergeType gameMergeType    = ((BackupDropdownItem)gameMergeComboBox.SelectedItem).ValueMember;

                //create restore dialog with merge settings
                dlg = new Conf_RestoreDlg(restorePathTextBox.Text, emuMergeType, profileMergeType, gameMergeType);
            }
            else //else clean restore
            {
                //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;
                }

                //create restore dialog
                dlg = new Conf_RestoreDlg(restorePathTextBox.Text, RestoreType.Restore);
            }
            dlg.RestoreThumbs = restoreThumbsCheckBox.Checked;
            //display dialog (starts restore)
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Restore completed successfully.");
            }
            dlg.Dispose();
        }
Example #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, RestoreType.Backup))
     {
         dlg.BackupThumbs = backupThumbsCheckBox.Checked;
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             MessageBox.Show("Backup completed successfully.");
         }
     }
 }