private void CheckFirmWareDetails(string url) { try { this.Invoke(new Action(() => { dataGridView1.Rows.Clear(); })); RomDetails.RomDetailsClass details = new RomDetails.RomDetailsClass(); RomDetails.GetFirmwareDetails(this, url, ref details, 1); this.Invoke(new Action(() => { for (int i = 0, j = details.SupportedVersions.Length; i < j; i++) { if (details.SupportedVersions[i].Length > 2) { dataGridView1.Rows.Add((i + 1).ToString(), details.SupportedVersions[i]); } } })); } catch (Exception e) { if (!e.Message.StartsWith("Thread was being")) { MessageBox.Show(e.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void CheckFirmWareData(string url) { try { this.Invoke(new Action(() => { materialRadioButton1.Checked = false; materialRadioButton1.Enabled = false; materialRadioButton1.Text = "Checking"; })); RomDetails.RomDetailsClass details = new RomDetails.RomDetailsClass(); RomDetails.GetFirmwareDetails(this, url, ref details, 0); this.Invoke(new Action(() => { if (details.ApprovedForInstall) { materialRadioButton1.Text = "Approved for installation"; materialRadioButton1.Enabled = true; materialRadioButton1.Checked = true; } else { materialRadioButton1.Text = "Not Approved for installation"; materialRadioButton1.Enabled = false; materialRadioButton1.Checked = false; } })); } catch (Exception e) { this.Invoke(new Action(() => { materialRadioButton1.Enabled = false; materialRadioButton1.Text = "ERROR"; })); MessageBox.Show(e.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }