void ColorPanel(Panel pPanel, string Name) { WindowsConfig GoodCfg = null; foreach (WindowsConfig cfg in WindowsConfigMngt.AllWindows) { if (cfg.WindowsName == Name) { GoodCfg = cfg; break; } } if (GoodCfg == null) { return; } if (GoodCfg.State) { pPanel.BackColor = Color.LightGreen; } else { pPanel.BackColor = Color.Red; } }
private void button2_Click(object sender, EventArgs e) { if (cmb_cfg_Windows.SelectedItem == null) { return; } try { WindowsConfig cfg = (WindowsConfig)cmb_cfg_Windows.SelectedItem; cfg.WindowsRevitId = _SelectedId; WindowsConfigMngt.Save(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }