示例#1
0
 private void backup_Click(object sender, EventArgs e)
 {
     if (DBSync.backup(backupLocationText.Text))
     {
         MessageBox.Show("Done!", "Backup database", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         MessageBox.Show("Could not backup. Please check that the path \nspecified is correct and that you have write permissions.", "Backup database", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
 private void restore_Click_1(object sender, EventArgs e)
 {
     if (DBSync.restore(restoreLocationText.Text))
     {
         MessageBox.Show("Done!", "Restoring database", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         MessageBox.Show("Could not restore. Please check that the path \nspecified is correct and that the file is valid.", "Restoring database", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
        private void export_Click(object sender, EventArgs e)
        {
            List <Game> items = new List <Game>();

            foreach (Emulator emu in DB.Instance.GetEmulators())
            {
                foreach (Game game in DB.Instance.GetGames(emu))
                {
                    items.Add(game);
                }
            }
            if (DBSync.export(items.ToArray(), exportText.Text))
            {
                MessageBox.Show("Done!", "Exporting meta data", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Could not export. Please check that the path \nspecified is correct and that you have write permissions.", "Exporting meta data", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#4
0
        private void import_Click(object sender, EventArgs e)
        {
            List <Game> items = new List <Game>();

            foreach (Emulator emu in DB.Instance.GetEmulators())
            {
                foreach (Game game in DB.Instance.GetGames(emu))
                {
                    items.Add(game);
                }
            }
            if (DBSync.import(items.ToArray(), importText.Text, !noOverwritingCheck.Checked))
            {
                MessageBox.Show("Done!", "Importing meta data", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Could not import. Please check that the path \nspecified is correct and that the file is valid.", "Importing meta data", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }