Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }