private void btnBatchAll_Click(object sender, EventArgs e) { bool FoundStart = false; foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Selected) { FoundStart = true; } if (FoundStart) { Game selected = (Game)row.Tag; Conf_OnlineLookup detailsForm = new Conf_OnlineLookup(selected, true); detailsForm.StartPosition = FormStartPosition.CenterScreen; if (detailsForm.ShowDialog() == DialogResult.Abort) { break; } } } update(); }
private void btnBatchNew_Click(object sender, EventArgs e) { foreach (DataGridViewRow row in dataGridView1.Rows) { Game selected = (Game)row.Tag; bool NeedsUpdate = false; if (selected.Yearmade == 0) { NeedsUpdate = true; } else if (selected.Grade == 0) { NeedsUpdate = true; } else if (selected.Genre == "") { NeedsUpdate = true; } else if (selected.Description == "") { NeedsUpdate = true; } else if (selected.Company == "") { NeedsUpdate = true; } else if (ThumbsHandler.Instance.createGameArt(selected, "BoxFront", false) == "") { NeedsUpdate = true; } else if (ThumbsHandler.Instance.createGameArt(selected, "BoxBack", false) == "") { NeedsUpdate = true; } else if (ThumbsHandler.Instance.createGameArt(selected, "TitleScreenshot", false) == "") { NeedsUpdate = true; } else if (ThumbsHandler.Instance.createGameArt(selected, "IngameScreenshot", false) == "") { NeedsUpdate = true; } if (NeedsUpdate) { Conf_OnlineLookup detailsForm = new Conf_OnlineLookup(selected, true); detailsForm.StartPosition = FormStartPosition.CenterScreen; if (detailsForm.ShowDialog() == DialogResult.Abort) { break; } } } update(); }
private void btnUpdateAll_Click(object sender, EventArgs e) { bool FoundStart = false; bool aborted = false; bool unattended = false; //check if we want to run an unnattended import DialogResult uaDlg = MessageBox.Show("Run unattended import based on import settings?", "", MessageBoxButtons.YesNo); if (uaDlg == DialogResult.Yes) { unattended = true; } List <string> skipped = new List <string>(); foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Selected) //start at selected row { FoundStart = true; } if (FoundStart) { Game selected = (Game)row.Tag; Conf_OnlineLookup detailsForm = new Conf_OnlineLookup(selected, false, unattended); detailsForm.StartPosition = FormStartPosition.CenterScreen; DialogResult dlg = detailsForm.ShowDialog(); if (dlg == DialogResult.Abort) //user aborted, quit loop { aborted = true; break; } if (unattended && dlg != DialogResult.OK) //no match was found during unattended import { skipped.Add(selected.Title); } } } if (unattended) { //show list of all items that were skipped Conf_UnattendedResult uaResults = new Conf_UnattendedResult(string.Format("Import {0}", aborted ? "aborted" : "finished"), skipped); uaResults.ShowDialog(); uaResults.Dispose(); } update(); }
private void btnUpdateWithoutData_Click(object sender, EventArgs e) { bool aborted = false; bool unattended = false; List <string> skipped = new List <string>(); DialogResult uaDlg = MessageBox.Show("Run unattended import based on import settings?", "", MessageBoxButtons.YesNo); if (uaDlg == DialogResult.Yes) { unattended = true; } foreach (DataGridViewRow row in dataGridView1.Rows) { Game selected = (Game)row.Tag; if (selected.Yearmade == 0) { Conf_OnlineLookup detailsForm = new Conf_OnlineLookup(selected, false, unattended); detailsForm.StartPosition = FormStartPosition.CenterScreen; DialogResult dlg = detailsForm.ShowDialog(); if (dlg == DialogResult.Abort) { aborted = true; break; } if (unattended && dlg != DialogResult.OK) { skipped.Add(selected.Title); } } } if (unattended) { Conf_UnattendedResult uaResults = new Conf_UnattendedResult(string.Format("Import {0}", aborted ? "aborted" : "finished"), skipped); uaResults.ShowDialog(); uaResults.Dispose(); } update(); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { bool LoadLocal = false; if (e.ColumnIndex == 1) { LoadLocal = false; } else if (e.ColumnIndex == 2) { LoadLocal = true; } else { return; } Game selected = (Game)dataGridView1.Rows[e.RowIndex].Tag; Conf_OnlineLookup detailsForm = new Conf_OnlineLookup(selected, LoadLocal); detailsForm.StartPosition = FormStartPosition.CenterScreen; if (detailsForm.ShowDialog() == DialogResult.OK) { update(); foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value.ToString() == selected.Path) { dataGridView1.CurrentCell = row.Cells[3]; break; } } } detailsForm.Dispose(); }