Esempio n. 1
0
        private void SlideBarHandler(SBarHook.SlideBar.SlideBarData sbData)
        {
            if (sbData.bEvent == SBarHook.SlideBar.Event.ServiceKey)
            {
                Dispatcher.Invoke(new Action(delegate
                {
                    this.Show();
                    this.Activate();
                    this.Focus();
                }), null);
                return;
            }
            if (sbData.bAction == SBarHook.SlideBar.SlideBarAction.On)
            {
                SBInputPos = sbData.bPosition;
            }

            Dispatcher.Invoke(new Action(delegate
            {
            }), null
                              );
        }
        private void SlideBarHandler(SBarHook.SlideBar.SlideBarData sbData)
        {
            if (sbData.bEvent == SlideBar.Event.ServiceKey)
            {
                Dispatcher.Invoke(new Action(delegate
                {
                    this.Show();
                    this.Activate();
                    this.Focus();
                }), null);
                return;
            }
            if (sbData.bAction == SlideBar.SlideBarAction.On)
            {
                SBInputPos = sbData.bPosition;
            }

            Dispatcher.Invoke(new Action(delegate
            {
                Random ran             = new Random();
                double estimated_value = sbData.bPosition + ran.NextDouble() - SBInputPos;
                estimated_value        = Math.Abs(estimated_value) > 255 ? 255 : estimated_value;
                if (estimated_value > 0)
                {
                    progressBarLeft.Value  = 0;
                    progressBarRight.Value = estimated_value;
                }
                else
                {
                    progressBarRight.Value = 0;
                    progressBarLeft.Value  = -estimated_value;
                }
                //HSBColor sdb = new HSBColor(sbData.bPosition, 255f, 255f);
                //progressBar1.Foreground = new SolidColorBrush(HSBColor.FromHSB(sdb));
                //Color.FromRgb(sbData.bPosition, sbData.bPosition, sbData.bPosition));
            }), null
                              );
        }