Exemplo n.º 1
0
 /// <summary>
 /// Activates the timer to go off at the specified timeout. Calling this method
 /// when the timer already is active will shift the timeout to the new value.
 /// </summary>
 /// <param name="newTimeout"> The new timeout value. </param>
 public virtual void Set(Timeout newTimeout)
 {
     lock (this)
     {
         _delay   = newTimeout.Next();
         _timeout = newTimeout;
         long jobId = NewJobId();
         _job = _scheduler.schedule(_group, () => handle(jobId), _delay.amount(), _delay.unit());
     }
 }