Exemplo n.º 1
0
 // Wait until time has elapsed, then check to see 
 // if anyone is listening, and send the message
 public void Run()
 {
     // sleep until time has elapsed
     Thread.Sleep(seconds * 1000);
     if (TimeExpired != null)
     {
         // Create the CountDownClockEventArgs to hold the message
         CountDownClockEventArgs e = new CountDownClockEventArgs(this.message);
         // fire the event
         TimeExpired(this, e);
     }
 }
Exemplo n.º 2
0
 // Wait until time has elapsed, then check to see
 // if anyone is listening, and send the message
 public void Run()
 {
     // sleep until time has elapsed
     Thread.Sleep(seconds * 1000);
     if (TimeExpired != null)
     {
         // Create the CountDownClockEventArgs to hold the message
         CountDownClockEventArgs e = new CountDownClockEventArgs(this.message);
         // fire the event
         TimeExpired(this, e);
     }
 }