private void Button4_Click(object sender, EventArgs e) { var device = this.manager.GetDevice(this.SelectIndex); if (device != null) { if (device.State == deviceState.CONNECT) { MapEdit mForm = new MapEdit(this.manager, this.manager.mapConfigs, device); mForm.ShowDialog(); mForm.Dispose(); } else { MessageBox.Show("设备未连接!"); } } }
public void ShowEdit(int index) { var device = this.manager.GetDevice(index); if (device != null) { if (device.State == deviceState.CONNECT) { MapEdit mForm = new MapEdit(this.manager, this.manager.mapConfigs, device); mForm.ShowDialog(); mForm.Dispose(); } else { ShowMsg("设备未连接!"); } } }