/// <summary>Called when the tracker becomes enters of leaves the idle state</summary> /// <param name="sender">Tracker that has entered or left the idle state</param> /// <param name="arguments">Contains the new idle state</param> private void asyncIdleStateChanged(object sender, IdleStateEventArgs arguments) { // Do a fully synchronous update of the idle state. This update must not be // lost because otherwise, the progress bar might stay on-screen when in fact, // the background operation has already finished and nothing is happening anymore. this.isIdle = arguments.Idle; // Update the bar's idle state if(InvokeRequired) { Invoke(this.updateIdleStateDelegate); } else { updateIdleState(); } }
public void TestIdleStateChangedToTrue() { IdleStateEventArgs idleStateFalse = new IdleStateEventArgs(true); Assert.IsTrue(idleStateFalse.Idle); }
public void TestIdleStateChangedToFalse() { IdleStateEventArgs idleStateFalse = new IdleStateEventArgs(false); Assert.IsFalse(idleStateFalse.Idle); }