Example #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);
     }
 }              // end run
Example #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);
     }
 }             // end run
Example #3
0
 // Alert the user that the time has expired
 public void TimeExpired(object theClock, CountDownClockEventArgs e)
 {
     Console.WriteLine("You requested to receive this message: {0}", e.message);
 }
Example #4
0
 // Alert the user that the time has expired
 public void TimeExpired(object theClock, CountDownClockEventArgs e)
 {
     Console.WriteLine("You requested to receive this message: {0}", e.message);
 }