/// <summary> /// This is our event handler (i.e. this is what will be called when the event is raised) /// Notice the method signature. /// </summary> /// <param name="theClock">The object that raised the event</param> /// <param name="e">Useful information about the event. Here we store the time of the event</param> public void TimeHasChanged(object theClock, TimeInfoEventArgs e) { Console.WriteLine($"The time is {e.hour}:{e.minute:00}:{e.second:00}"); }
public void WriteLogEntry(object theClock, TimeInfoEventArgs e) { Console.WriteLine($"Logging to a file: {e.hour}:{e.minute:00}:{e.second:00}"); }