Beispiel #1
0
        private void ButtonDeleteFace_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var streamDeckButton     = _streamDeckPanel.SelectedButton;
                var streamDeckButtonName = streamDeckButton.StreamDeckButtonName;

                streamDeckButton.Face.Dispose(); //todo this must be properly made
                streamDeckButton.Face = null;    //todo this must be properly made

                if (streamDeckButton.HasConfig)
                {
                    _streamDeckPanel.SelectedLayer.AddButton(streamDeckButton);
                }
                else
                {
                    _streamDeckPanel.SelectedLayer.RemoveButton(streamDeckButton);
                }
                UCStreamDeckButtonFace.Clear();
                _streamDeckPanel.ClearFace(streamDeckButtonName);
                EventHandlers.NotifyToSyncConfiguration(this, _streamDeckPanel.BindingHash);
                SetFormState();
            }
            catch (Exception ex)
            {
                Common.ShowErrorMessageBox(ex);
            }
        }
Beispiel #2
0
        private void ButtonDeleteAction_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var streamDeckButton = _streamDeckPanel.SelectedButton;
                if (streamDeckButton.ActionForPress != null && streamDeckButton.ActionForPress.ActionType == EnumStreamDeckActionType.LayerNavigation && streamDeckButton.Face != null)
                {
                    streamDeckButton.Face.Dispose();
                    streamDeckButton.Face = null;
                    UCStreamDeckButtonFace.Clear();
                }
                streamDeckButton.ActionForPress   = null;
                streamDeckButton.ActionForRelease = null;

                if (streamDeckButton.HasConfig)
                {
                    _streamDeckPanel.SelectedLayer.AddButton(streamDeckButton);
                }
                else
                {
                    _streamDeckPanel.SelectedLayer.RemoveButton(streamDeckButton);
                }

                UCStreamDeckButtonAction.Clear();

                EventHandlers.NotifyToSyncConfiguration(this, _streamDeckPanel.BindingHash);
                SetFormState();
            }
            catch (Exception ex)
            {
                Common.ShowErrorMessageBox(ex);
            }
        }