static void Main(string[] args) { // TODO: Create publishers and subscriber StockPublisher p1 = new StockPublisher("MSFT"); StockPublisher p2 = new StockPublisher("WCB"); StockSubscriber subscriber = new StockSubscriber(); subscriber.SubscribeTo(p1); subscriber.SubscribeTo(p2); Console.ReadLine(); }
public void SubscribeTo(StockPublisher p) { p.StockChanged += OnStockChanged; }