private void OnCameHandler(Person person, ComeTimeEventArgs comeTime) { Console.WriteLine(); Console.WriteLine($"[На работу пришел {person.Name}.]"); greetAll?.Invoke(person, comeTime); greetAll += person.SayHello; byeAll += person.SayGoodbye; }
public void SayHello(Person person, ComeTimeEventArgs comeTime) { var salute = String.Empty; if (comeTime.ComeTime.Hour < 12) { salute = "Доброе утро"; } else if (comeTime.ComeTime.Hour < 17) { salute = "Добрый день"; } else { salute = "Добрый вечер"; } Console.WriteLine($"'{salute}, {person.Name}!', - сказал {Name}."); }