示例#1
0
 /// <summary>
 /// Specify an action to call when this Timer ends
 /// </summary>
 /// <param name="callback">The action to call when this Timer ends</param>
 public void Then(PulseTask callback)
 {
     if (completionCallback == null)
     {
         completionCallback = callback;
     }
     else
     {
         throw new PulseException("You cannot supply more than one completion callback for a timer.");
     }
 }
示例#2
0
 /// <summary>
 /// Specify the action to perform on each tick
 /// </summary>
 /// <param name="something">The action to perform</param>
 /// <returns>This Timer instance</returns>
 public PulseTimer Do(PulseTask something)
 {
     if (TickTask == null)
     {
         TickTask = something;
         return(this);
     }
     else
     {
         throw new PulseException("You cannot call Do() twice on the same Timer.");
     }
 }