private void Button6_Click(object sender, EventArgs e) { var device = this.manager.GetDevice(this.SelectIndex); if (device != null) { if (device.State == deviceState.CONNECT) { manager.ChangeLed(this.SelectIndex); } else { MessageBox.Show("设备未连接!"); } } }
public void ChangeLed(int index) { var device = this.manager.GetDevice(index); if (device != null) { if (device.State == deviceState.CONNECT) { manager.ChangeLed(index); } else { ShowMsg("设备未连接!"); } } }
private void Button6_Click(object sender, EventArgs e) { manager.ChangeLed(this.SelectIndex); }