public void UpdateMarketData(Quote quote) { if (stockForm != null) { stockForm.UpdateMarketData(quote); } }
public void UpdateMarketData(Quote quote) { Invoke(new MethodInvoker( delegate { marketDataListBox.Items.Insert(0, string.Format("{0}.{1} {2}", quote.Stock.StockExchange, quote.Stock.Ticker, quote.Price)); //ensure that there are never more than 50 entries in the listbox (to prevent endlessly-growing data) if (marketDataListBox.Items.Count == 50) { marketDataListBox.Items.RemoveAt(49); } })); }
public void Handle(Quote quote) { log.Info(string.Format("Received market data. Ticker = {0}, Price = {1}", quote.Stock.Ticker, quote.Price)); // forward to controller to update view _stockController.UpdateMarketData(quote); }