private void comboBox1_SelectedValueChanged(object sender, EventArgs e) { ComboBox cbb = sender as ComboBox; if (this.timer1.Enabled) this.timer1.Enabled = false; if (cbb.Text == string.Empty) return; if (cic != null) cic.Dispose(); cic = new com_io_ctl(cbb.Text, Application.StartupPath + @"\io.ini"); cic.readEvent += new com_io_ctl.ReadEventHandler(cic_readEvent); this.timer1.Enabled = true; }
private void Form2_Load(object sender, EventArgs e) { this.toolStripStatusLabel1.Text = string.Empty; string[] gpioName = new string[16]; for (int i = 0; i < gpioName.Length; i++) { gpioName[i] = i.ToString(); } this.checkedListBox1.Items.AddRange(gpioName); this.checkedListBox2.Items.AddRange(gpioName); this.checkedListBox3.Items.AddRange(gpioName); this.checkedListBox4.Items.AddRange(gpioName); this.checkedListBox5.Items.AddRange(gpioName); this.cic = new com_io_ctl(Application.StartupPath + @"\io.ini"); this.checkedListBox6.Items.Clear(); this.checkedListBox6.Items.AddRange(this.cic.stateName.ToArray()); }