Exemplo n.º 1
0
 // the method that implements the
 // delegated functionality
 public void TimeHasChanged(object theClock, TimeInfoEventArgs ti)
 {
     Console.WriteLine("Current Time: {0}:{1}:{2}", ti.hour.ToString(), ti.minute.ToString(), ti.second.ToString());
 }
Exemplo n.º 2
0
 // this method should write to a file
 // we write to the console to see the effect
 // this object keeps no state
 public void WriteLogEntry(object theClock, TimeInfoEventArgs ti)
 {
     Console.WriteLine("Logging to file: {0}:{1}:{2}", ti.hour.ToString(), ti.minute.ToString(), ti.second.ToString());
 }