/// <summary> /// Initialises a new instance of the <see cref="EVEMon.MouseState"/> class with the given trayIcon and mousePosition /// </summary> /// <param name="trayIcon">The <see cref="EVEMon.TrayIcon"/> whose state is being managed.</param> /// <param name="mousePosition">A <see cref="System.Drawing.Point"/> representing the last known mouse location.</param> public MouseStateHovering(TrayIcon trayicon, Point mousePosition) : base(trayicon, mousePosition) { // Fire the MouseHover event trayIcon.OnMouseHover(new EventArgs()); // Lock the syncLock to make sure the timer is initialised before mouse events are handled lock (syncLock) { // Start tracking the mouse EnableMouseTracking(); // Start the timer to monitor mouse position this.timer = new System.Threading.Timer(new System.Threading.TimerCallback(MouseMonitor), null, 100, System.Threading.Timeout.Infinite); } }
/// <summary> /// Initialises a new instance of the <see cref="EVEMon.MouseState"/> class with the given trayIcon and mousePosition /// </summary> /// <param name="trayIcon">The <see cref="EVEMon.TrayIcon"/> whose state is being managed.</param> /// <param name="mousePosition">A <see cref="System.Drawing.Point"/> representing the last known mouse location.</param> public MouseStateOver(TrayIcon trayIcon, Point mousePosition) : base(trayIcon, mousePosition) { // Store the existing icon text, then reset it trayIcon.iconText = trayIcon.notifyIcon.Text; trayIcon.notifyIcon.Text = String.Empty; // Start the timer and enable mouse tracking // Lock the syncLock since we don't know the timeout value and need to ensure // initialisation completes before the timeout occurs lock (syncLock) { // Start the hover timer this.timer = new System.Threading.Timer(new System.Threading.TimerCallback(HoverTimeout), null, this.trayIcon.MouseHoverTime, System.Threading.Timeout.Infinite); // Start tracking the mouse EnableMouseTracking(); } }
/// <summary> /// Initializes a new instance of the <see cref="EVEMon.TrayIcon.MouseStateOut"/> class for a given trayIcon. /// </summary> /// <param name="trayIcon">A <see cref="EVEMon.TrayIcon"/> whose state we are managing.</param> public MouseStateOut(TrayIcon trayIcon) : base(trayIcon, new Point(0,0)) { EnableMouseTracking(); }
/// <summary> /// Initialises a new instance of the <see cref="EVEMon.MouseState"/> class with the given trayIcon and mousePosition /// </summary> /// <param name="trayIcon">The <see cref="EVEMon.TrayIcon"/> whose state is being managed.</param> /// <param name="mousePosition">A <see cref="System.Drawing.Point"/> representing the last known mouse location.</param> public MouseState(TrayIcon trayIcon, Point mousePosition) { this.trayIcon = trayIcon; this.mousePosition = mousePosition; syncLock = new Object(); }
/// <summary> /// Initializes a new instance of the <see cref="EVEMon.TrayIcon.MouseStateOut"/> class for a given trayIcon. /// </summary> /// <param name="trayIcon">A <see cref="EVEMon.TrayIcon"/> whose state we are managing.</param> public MouseStateOut(TrayIcon trayIcon) : base(trayIcon, new Point(0, 0)) { EnableMouseTracking(); }