private void button_Reload_Click(object sender, EventArgs e) { if (theDevice != null) { theDevice.Close(); theDevice = null; } if (theEeprom != null) { theEeprom = null; } comboBox_Interfaces.DataSource = null; comboBox_Interfaces.Items.Clear(); MainForm_Load(sender, e); }
private void comboBox_Interfaces_SelectionChangeCommitted(object sender, EventArgs e) { if (comboBox_Interfaces.Items.Count != 0) { if (theDevice != null) { theDevice.Close(); } theDevice = comboBox_Interfaces.SelectedItem as Re4xProc.Re4xDevice; if (theDevice != null) { theDevice.Open(); theEeprom = theDevice.ReadEEPROM(); RefreshEnable(); } } }