private void btnImportGame_Click(object sender, EventArgs e) //Import Game button { lblStatus.Text = "Importing..."; DisableAllControls(); using (var fbd = new OpenFileDialog()) { DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.FileName)) { if (Path.GetExtension(fbd.FileName) == ".xml") { string fileName = Path.GetFileNameWithoutExtension(fbd.FileName); XML_IO.importXML(fbd.FileName, fileName); } else { MessageBox.Show("The file needs to be an xml"); } } bwLoadGames.RunWorkerAsync(); } }
private void bwLoadGameToExport_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { UseWaitCursor = false; XML_IO.exportXML(selectedGame); EnableAllControls(); }
private void exportGameToolStripMenuItem_Click(object sender, EventArgs e) { DisableAllControls(); XML_IO.exportXML(game); EnableAllControls(); }