示例#1
0
 protected override void Dispose(bool dispose)
 {
     if (dispose)
     {
         _cancellationTokenSource?.Dispose();
         StackPanelButtonUI.Children.Clear();
         EventHandlers.DetachStreamDeckListener(UCStreamDeckButtonAction);
         EventHandlers.DetachStreamDeckListener(UCStreamDeckButtonFace);
         EventHandlers.DetachStreamDeckListener(_uiButtonGrid);
         EventHandlers.DetachStreamDeckConfigListener(_uiButtonGrid);
         EventHandlers.DetachStreamDeckListener(this);
         _streamDeckPanel.Dispose();
     }
 }
示例#2
0
 private void Dispose(bool disposing)
 {
     ReleaseUnmanagedResources();
     if (disposing)
     {
         StreamDeckButton.DisposeAll();
         _streamDeckBoard.KeyStateChanged -= StreamDeckKeyListener;
         _streamDeckBoard?.Dispose();
         StreamDeckPanels.Remove(this);
         EventHandlers.DetachStreamDeckListener(this);
         EventHandlers.DetachStreamDeckConfigListener(this);
         Closed = true;
     }
 }