void findfirmware(string findwhat) { List <software> items = new List <software>(); // build list foreach (software temp in softwares) { if (temp.url.ToLower().Contains(findwhat.ToLower())) { items.Add(temp); } } // none found if (items.Count == 0) { CustomMessageBox.Show("The requested firmware was not found."); return; } else if (items.Count == 1) // 1 found so accept it { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + items[0].name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { update(items[0]); } return; } else if (items.Count == 2 && false) { XorPlus select = new XorPlus(); ThemeManager.ApplyThemeTo(select); select.ShowDialog(); int a = 0; if (select.frame == "") { return; } foreach (software temp in items) { if (select.frame == "+" && temp.name.Contains("Plus")) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + items[a].name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { update(items[a]); return; } } else if (select.frame == "X" && temp.name.Contains("X")) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + items[a].name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { update(items[a]); return; } } a++; } } else { CustomMessageBox.Show("Something has gone wrong, to many firmware choices"); return; } }
void findfirmware(string findwhat) { List<software> items = new List<software>(); // build list foreach (software temp in softwares) { if (temp.url.ToLower().Contains(findwhat.ToLower())) { items.Add(temp); } } // none found if (items.Count == 0) { CustomMessageBox.Show("The requested firmware was not found."); return; } else if (items.Count == 1) // 1 found so accept it { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + items[0].name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { update(items[0]); } return; } else if (items.Count == 2 && false) { XorPlus select = new XorPlus(); ThemeManager.ApplyThemeTo(select); select.ShowDialog(); int a = 0; if (select.frame == "") { return; } foreach (software temp in items) { if (select.frame == "+" && temp.name.Contains("Plus")) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + items[a].name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { update(items[a]); return; } } else if (select.frame == "X" && temp.name.Contains("X")) { DialogResult dr = CustomMessageBox.Show("Are you sure you want to upload " + items[a].name + "?", "Continue", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { update(items[a]); return; } } a++; } } else { CustomMessageBox.Show("Something has gone wrong, to many firmware choices"); return; } }