Ejemplo n.º 1
0
        private void timerIdleDetection_Tick(object sender, EventArgs e)
        {
            Win32.LASTINPUTINFO lastInputInfo = new Win32.LASTINPUTINFO();
            lastInputInfo.cbSize = Marshal.SizeOf(lastInputInfo);
            lastInputInfo.dwTime = 0;
            if (!Win32.GetLastInputInfo(out lastInputInfo))
            {
                return;
            }
            int idle_seconds = unchecked (Environment.TickCount - (int)lastInputInfo.dwTime) / 1000;

            if (idle_seconds < 1)
            {
                return;
            }
            Toggl.SetIdleSeconds((ulong)idle_seconds);
        }
 private void timerIdleDetection_Tick(object sender, EventArgs e)
 {
     Win32.LASTINPUTINFO lastInputInfo = new Win32.LASTINPUTINFO();
     lastInputInfo.cbSize = Marshal.SizeOf(lastInputInfo);
     lastInputInfo.dwTime = 0;
     if (!Win32.GetLastInputInfo(out lastInputInfo)) {
     return;
     }
     int idle_seconds = unchecked(Environment.TickCount - (int)lastInputInfo.dwTime) / 1000;
     if (idle_seconds < 1) {
     return;
     }
     Toggl.SetIdleSeconds((ulong)idle_seconds);
 }