Esempio n. 1
0
 protected virtual void OnNumberReached(NumberReachedEventArgs e)
 {
     if (NumberReached != null)
     {
         NumberReached(this, e);
     }
 }
Esempio n. 2
0
 public void CountTo(int countTo, int reachableNum)
 {
     if (countTo < reachableNum)
     {
         throw new ArgumentException("reachableNum should be less than countTo");
     }
     for (int ctr = 0; ctr <= countTo; ctr++)
     {
         if (ctr == reachableNum)
         {
             NumberReachedEventArgs e = new NumberReachedEventArgs(reachableNum);
             OnNumberReached(e);
             return;
         }
     }
 }