ComponentFactory.Krypton.Toolkit.TrackBarController.MouseMove C# (CSharp) Method

MouseMove() public method

Mouse has moved inside the view.
public MouseMove ( Control c, Point pt ) : void
c System.Windows.Forms.Control Reference to the source control instance.
pt Point Mouse position relative to control.
return void
        public virtual void MouseMove(Control c, Point pt)
        {
            if (_captured)
            {
                // Only interested if the mouse is over the track area
                if (_drawTB.ClientRectangle.Contains(pt))
                {
                    // Ignore multiple calls with the same point
                    if ((_lastMovePt == null) || (_lastMovePt != pt))
                    {
                        _lastMovePt = pt;

                        // Restart the timer
                        _repeatTimer.Stop();
                        _repeatTimer.Start();

                        // Only use newly calculated target value if in correct direction
                        int newTargetValue = _drawTB.NearestValueFromPoint(pt);
                        int currentValue = _drawTB.ViewDrawTrackBar.Value;
                        if (_targetHigher)
                        {
                            if (newTargetValue > currentValue)
                                _targetValue = newTargetValue;
                        }
                        else
                        {
                            if (newTargetValue < currentValue)
                                _targetValue = newTargetValue;
                        }

                        OnRepeatTimer(_repeatTimer, EventArgs.Empty);
                    }
                }
            }
        }