Example #1
0
 private void OnTimerTick(object state)
 {
     syncContext.Invoke(() =>
     {
         LimitReached(this, new LimitReachedArgs(Limit));
     });
 }
Example #2
0
 private void OnTimerTick(Object state)
 {
     syncContext.Invoke(() =>
     {
         var hWnd = NativeMethods.GetForegroundWindow();
         if (hWnd != IntPtr.Zero && hWnd != activeWindowHandle)
         {
             SetActiveWindow(hWnd);
         }
     });
 }
Example #3
0
 private void CheckIdleState(object sender)
 {
     syncContext.Invoke(s =>
     {
         var idleTimeSpan = IdleTimeWatcher.GetIdleTimeSpan();
         if (idleTimeSpan >= TimeSpan.FromMilliseconds(settingsService.Settings.IdleTimer))
         {
             idleEntered = true;
             idleTimer.Change(Timeout.Infinite, Timeout.Infinite);
             SetHooks();
             IdleEntered.InvokeSafely(this, EventArgs.Empty);
         }
     });
 }