/// <summary> /// Sets the mouse mover state and raises event /// to notify /// </summary> /// <param name="state"></param> private void setStateAndNotify(MouseMoverStates state) { _currentState = state; if (EvtMouseMoverStateChanged != null) { EvtMouseMoverStateChanged(this, new MouseMoverStateChangedEventArgs(state)); } }
/// <summary> /// Initializes the class variables /// </summary> public void Init() { // don't use setState because we don't want to trigger events before // it is prudent to do so _currentState = MouseMoverStates.Idle; _boundWidth = Screen.PrimaryScreen.Bounds.Width; _boundHeight = Screen.PrimaryScreen.Bounds.Height; Log.Debug("boundWidth=" + _boundWidth + " boundHeight=" + _boundHeight); _gridPenColor = Color.FromArgb(255, 255, 0, 0); initGridLine(); var timerDelegate = new TimerQueue.WaitOrTimerDelegate(mmTimer_Tick); _mouseMoverTimer = new TimerQueue(DefaultTimerInterval, DefaultTimerInterval, timerDelegate); }
/// <summary> /// Initializes mouse mover /// </summary> public void Init() { _currentState = MouseMoverStates.Idle; _boundWidth = Screen.PrimaryScreen.Bounds.Width; _boundHeight = Screen.PrimaryScreen.Bounds.Height; Log.Debug("boundWidth=" + _boundWidth + " boundHeight=" + _boundHeight); // we could use the radius of the current form/window // or allow the controlling app to pass in a specific radius //radius = boundWidth; // half the screen _radius = 20000; _penColor = Color.FromArgb(255, 255, 0, 0); initRadarLine(); var timerDelegate = new TimerQueue.WaitOrTimerDelegate(mmTimer_Tick); _mouseMoverTimer = new TimerQueue(DefaultTimerInterval, DefaultTimerInterval, timerDelegate); }
public MouseMoverStateChangedEventArgs(MouseMoverStates state) { State = state; }