private void editDeviceButton_Click(object sender, EventArgs e) { // Determine the device that is being edited SelectedDevice selectedDevice = DetermineSelectedLogicalChannelFromGrid(); if (selectedDevice == null) // Abort if nothing is selected { return; } EditDevice editDevice = new EditDevice(selectedDevice, this); editDevice.ShowDialog(); editDevice.Dispose(); //Change row's color if the channel is one that is supposed to turn off if AI check fails if (Storage.settingsData.ChannelsToTurnOff[selectedDevice.channelType].ContainsKey(selectedDevice.logicalID)) { logicalDevicesDataGridView.SelectedRows[0].DefaultCellStyle.BackColor = System.Drawing.Color.LightSlateGray; } else { logicalDevicesDataGridView.SelectedRows[0].DefaultCellStyle.BackColor = System.Drawing.Color.White; } }
/// <summary> /// Launch the EditDevice form /// </summary> private void logicalDevicesDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // Determine the device that is being edited SelectedDevice selectedDevice = DetermineSelectedLogicalChannelFromGrid(); if (selectedDevice == null) // Abort if nothing is selected { return; } EditDevice editDevice = new EditDevice(selectedDevice, this); editDevice.ShowDialog(); editDevice.Dispose(); }
/// <summary> /// Launch the EditDevice form /// </summary> private void logicalDevicesDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // Determine the device that is being edited SelectedDevice selectedDevice = DetermineSelectedLogicalChannelFromGrid(); if (selectedDevice == null) // Abort if nothing is selected return; EditDevice editDevice = new EditDevice(selectedDevice, this); editDevice.ShowDialog(); editDevice.Dispose(); }