Checkpoint: NotificationCenter
Challenge on lesson: Checkpoint โ Event-Driven Notification System
Implement the NotificationCenter described in the checkpoint:
``csharp
public sealed record NotificationEventArgs(string Id, string Channel, string Message);
public class NotificationCenter
{
public event EventHandler<NotificationEventArgs>? Published; /* every accepted notification */
public event EventHandler<NotificationEventArgs>? Filtered; /* every rejected notification */
/* publishes: filter null or filter(msg)==true -> raise Published;
otherwise raise Filtered. Ids are "n-1", "n-2", ... starting at 1
and incrementing for EVERY Publish call (accepted or not). */
public void Publish(string channel, string message, Predicate<string>? filter);
/* clears both subscription lists */
public void UnsubscribeAll();
}
``
Back to lesson: Checkpoint โ Event-Driven Notification System