public void OnCome(Employee e, OnComeEventArgs args) { Come?.Invoke(e, args); Come += e.SayHi; Leave += e.SayGoodby; }
public void SayHi(Employee e, OnComeEventArgs args) { string hello; if (args.Hours < 12) { hello = "Good morning"; } else if (args.Hours > 12 && args.Hours < 17) { hello = "Good day"; } else { hello = "Good evening"; } Console.WriteLine($"{hello}, {args.Name} - Said {Name}"); }