Example #1
0
 private void RevealerEnable()
 {
     if (!IsEnabled)
     {
         // Change one node of Icon colour to red.
         //this.ntiTrayIcon.Icon = GetTrayIcon();
         //mnuPasswordRevealer.Text = "Password Revealer: ON";
         //mnuPasswordRevealer.Checked = true;
         lock (mouseHookLock)
         {
             if (_MouseHook == null)
             {
                 // Create Global Hook Monitor.
                 _MouseHook = new MouseHook();
                 // Attach functions to events.
                 _MouseHook.OnMouseDown += new MouseEventHandler(RevealerMouseDown);
             }
         }
         lock (revealerTimerLock)
         {
             if (revealerTimer != null)
             {
                 //	 AutoOff after 1 minute.
                 revealerTimer.Interval = 6000;
                 revealerTimer.Enabled = true;
             }
         }
     }
 }
Example #2
0
 void DisposeMouseHook()
 {
     lock (mouseHookLock)
     {
         if (_MouseHook != null)
         {
             _MouseHook.OnMouseDown -= new MouseEventHandler(RevealerMouseDown);
             _MouseHook.Stop();
             _MouseHook.Dispose();
             _MouseHook = null;
         }
     }
 }