Exemplo n.º 1
0
        private void SessionSwitchHandler(object sender, SessionSwitchEventArgs e)
        {
            switch (e.Reason)
            {
            case SessionSwitchReason.SessionLock:
                gallifrey.StartIdleTimer();
                break;

            case SessionSwitchReason.SessionUnlock:
                var idleTimerId = gallifrey.StopIdleTimer();
                var idleTimer   = gallifrey.IdleTimerCollection.GetTimer(idleTimerId);
                if (idleTimer.ExactCurrentTime.TotalSeconds < 15)
                {
                    MessageBox.Show("Machine Locked For Less Than 15 Seconds.\nIf Your Machine Went Into Screensaver Without Being Locked The Idle Time Cannot Be Captured", "Short Idle Time", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    gallifrey.IdleTimerCollection.RemoveTimer(idleTimerId);
                }
                else
                {
                    var idleTimerWindow = new IdleTimerWindow(gallifrey);
                    if (idleTimerWindow.DisplayForm)
                    {
                        idleTimerWindow.ShowDialog();
                        RefreshTimerPages();
                    }
                }
                break;
            }
        }
Exemplo n.º 2
0
 private void btnIdle_Click(object sender, EventArgs e)
 {
     var idleTimerWindow = new IdleTimerWindow(gallifrey);
     if (idleTimerWindow.DisplayForm)
     {
         idleTimerWindow.ShowDialog();
         RefreshTimerPages();
     }
 }
Exemplo n.º 3
0
        private void btnIdle_Click(object sender, EventArgs e)
        {
            var idleTimerWindow = new IdleTimerWindow(gallifrey);

            if (idleTimerWindow.DisplayForm)
            {
                idleTimerWindow.ShowDialog();
                RefreshTimerPages();
            }
        }
Exemplo n.º 4
0
 private void SessionSwitchHandler(object sender, SessionSwitchEventArgs e)
 {
     switch (e.Reason)
     {
         case SessionSwitchReason.SessionLock:
             gallifrey.StartIdleTimer();
             break;
         case SessionSwitchReason.SessionUnlock:
             var idleTimerId = gallifrey.StopIdleTimer();
             var idleTimer = gallifrey.IdleTimerCollection.GetTimer(idleTimerId);
             if (idleTimer.ExactCurrentTime.TotalSeconds < 15)
             {
                 MessageBox.Show("Machine Locked For Less Than 15 Seconds.\nIf Your Machine Went Into Screensaver Without Being Locked The Idle Time Cannot Be Captured", "Short Idle Time", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 gallifrey.IdleTimerCollection.RemoveTimer(idleTimerId);
             }
             else
             {
                 var idleTimerWindow = new IdleTimerWindow(gallifrey);
                 if (idleTimerWindow.DisplayForm)
                 {
                     idleTimerWindow.ShowDialog();
                     RefreshTimerPages();
                 }
             }
             break;
     }
 }