public static void Depart(Person sender, TimeArgs e) { Console.WriteLine("{0} left.", sender.Name); greetByUs -= sender.Greet; goodByeByUs -= sender.GoodBye; goodByeByUs?.Invoke(sender.Name, e.time); }
public static void Arrive(Person sender, TimeArgs e) { Console.WriteLine("{0} came at {1} o'clock.", sender.Name, e.time.Hour); greetByUs?.Invoke(sender.Name, e.time); greetByUs += sender.Greet; goodByeByUs += sender.GoodBye; }