private void ClearAllBumps()
 {
     foreach (SoloSuppressButton btn in _bumpButtons)
     {
         btn.LitLeft = false;
         DMXController.SetLevel(btn.Name, ParseTag(btn), 0);
     }
 }
 private void ClearAllSliders()
 {
     foreach (Slider slider in _sliders)
     {
         slider.Value = 0;
         DMXController.SetLevel(slider.Name, ParseTag(slider), 0);
     }
 }
        private void tbr_Scroll(object sender, EventArgs e)
        {
            string tbarName = ((Slider)sender).Name;
            // Zach discovered Tag, which works great for this
            // Get the channel number from the tag
            int channelNum = ParseTag((Control)sender);
            int intensity  = Convert.ToInt32(((Slider)sender).Value);

            DMXController.SetLevel(tbarName, channelNum, intensity);
        }
 public void HTPFlush()
 {
     foreach (SoloSuppressButton btn in _bumpButtons)
     {
         if (btn.LitLeft)
         {
             DMXController.SetLevel(btn.Name, ParseTag(btn), 255);
         }
     }
     foreach (Slider tbar in _sliders)
     {
         DMXController.SetLevel(tbar.Name, ParseTag(tbar), Convert.ToInt32(tbar.Value));
     }
 }
        private void bump_MouseDown(object sender, MouseEventArgs e)
        {
            SoloSuppressButton btn = (SoloSuppressButton)sender;

            // Zach discovered Tag, which works great for this
            // Get the channel number from the tag
            int channelNum = ParseTag((Control)sender);

            if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
            {
                DMXController.FlushHTP(channelNum);
                if (btn.LitLeft)
                {
                    DMXController.SetLevel(btn.Name, channelNum, 255);
                }
                DMXController.SetLevel(_sliders[channelNum - 1].Name, channelNum, Convert.ToInt32(_sliders[channelNum - 1].Value));
            }

            else if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
            {
                _shiftPressed = true;
                if (!DMXController.IsSuppressed(channelNum))
                {
                    DMXController.Suppress(channelNum);
                    btn.LitRight = true;
                }
                else
                {
                    DMXController.Unsuppress(channelNum);
                    btn.LitRight = false;
                }
            }

            else
            {
                // Set the level
                string buttonName = btn.Name;
                DMXController.SetLevel(buttonName, channelNum, 255);

                // If it was a right-click, toggle
                if (e.RightButton == MouseButtonState.Pressed)
                {
                    btn.LitLeft = !btn.LitLeft;
                }
            }
        }
        private void bump_MouseUp(object sender, MouseEventArgs e)
        {
            SoloSuppressButton btn = (SoloSuppressButton)sender;
            // Zach discovered Tag, which works great for this
            // Get the channel number from the tag
            int channelNum = ParseTag((Control)sender);

            if (_shiftPressed)
            {
                _shiftPressed = false;
            }

            else
            {
                // Turn the channel off if it wasn't right-clicked.
                string buttonName = btn.Name;
                if (!btn.LitLeft)
                {
                    DMXController.SetLevel(buttonName, channelNum, 0);
                }
            }
        }