public void Publish() { if(OnPublish!= null) { NotificationEvent notificationEvent = new NotificationEvent($"Published form {Name}", DateTime.Now); OnPublish(this, notificationEvent); } }
protected virtual void OnNotificationRecieved(Publisher publisher, NotificationEvent notificationEvent) { Console.WriteLine($"Hey, {SubsriberName}, {notificationEvent.NotificationMessage} - {publisher.Name} at {notificationEvent.NotificationDate}"); }