コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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);
            }
        }