public static void RunDemo() { StockTicker stockTicker = new StockTicker(); //// ReSharper disable UnusedVariable GoogleObserver googleObserver = new GoogleObserver(stockTicker); MicrosoftObserver microsoftObserver = new MicrosoftObserver(stockTicker); //// ReSharper restore UnusedVariable foreach (var stock in SampleData.GetNext()) { stockTicker.Stock = stock; } }
public MicrosoftObserver(StockTicker subj) { DataSource = subj; subj.Register(this); }
public GoogleObserver(StockTicker subj) { DataSource = subj; subj.Register(this); }