private void InternalTickerElapsed(object sender, ElapsedEventArgs e) { uint idleTime = Win32Wrapper.GetIdle(); if (idleTime > (MaxIdleTime * 1000)) { if (m_IsIdle == false) { lock (m_LockObject) { m_IsIdle = true; } IdleEventArgs args = new IdleEventArgs(e.SignalTime); if (OnEnterIdleState != null) { OnEnterIdleState(this, args); } } } else { if (m_IsIdle) { lock (m_LockObject) { m_IsIdle = false; } IdleEventArgs args = new IdleEventArgs(e.SignalTime); if (OnExitIdleState != null) { OnExitIdleState(this, args); } } } }
//EVENT System idle timer - On idle timeout met public void SystemIdleTimer1_OnEnterIdleState(Object sender, IdleEventArgs e) { if (lync.LyncClientSignedIn) { lync.SetAvailabilityInfo(Settings.PsSetMeAsAvailability1); processIcon.BalloonTip( processFriendlyName + " Status Change", "Your computer has been idle for " + Settings.PsSetMeAsTime1 + " seconds." + Environment.NewLine + "Availability: " + Settings.PsSetMeAsAvailability1, balloonTipTime); } //presenceTimerSetMeAs1ActiveProcessed = true; }
//EVENT System idle timer - On idle end public void SystemIdleTimer1_OnExitIdleState(Object sender, IdleEventArgs e) { //MessageBox.Show("Welcome back!"); if (lync.LyncClientSignedIn) { lync.SetAvailabilityInfo("Available"); processIcon.BalloonTip( processFriendlyName + " Status Change", "Your computer has come out of an idle state." + Environment.NewLine + "Availability: Available", balloonTipTime); } ResetPresenceTimer(); }