private void DataGridStreamDeckButtons_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (DataGridStreamDeckButtons.SelectedItems.Count != 1) { SetComboBoxButtonNameValueNone(); } else { var buttonExport = (ButtonExport)DataGridStreamDeckButtons.SelectedItems[0]; SetComboBoxButtonNameValue(StreamDeckCommon.ButtonNumber(buttonExport.Button.StreamDeckButtonName)); } if (DataGridStreamDeckButtons.SelectedItems.Cast <ButtonExport>().ToList().Select(m => m.LayerName).Distinct().ToList().Count > 1) { ComboBoxLayers.Text = string.Empty; } else if (DataGridStreamDeckButtons.SelectedItems.Count == 1) { ComboBoxLayers.Text = ((ButtonExport)DataGridStreamDeckButtons.SelectedItems[0]).LayerName; } else if (DataGridStreamDeckButtons.SelectedItems.Count == 0) { ComboBoxLayers.Text = string.Empty; } SetFormState(); } catch (Exception ex) { Common.ShowErrorMessageBox(ex); } }
private void UpdateButtonInfoFromSource() { HideAllDotImages(); foreach (var buttonImage in ButtonImages) { buttonImage.Bill.Clear(); var streamDeckButton = StreamDeckPanelInstance.SelectedLayer.GetStreamDeckButton(buttonImage.Bill.StreamDeckButtonName); buttonImage.Bill.Button = streamDeckButton; if (streamDeckButton.HasConfig) { SetDotImageStatus(true, StreamDeckCommon.ButtonNumber(streamDeckButton.StreamDeckButtonName)); } } }