public Stock() { this.stocksInfo = new StockInfo(); }
public Stock() { stocksInfo = new StockInfo(); }
private void OnUpdate(StockInfo info) { Update(this, info); }
/// <summary> /// Initializes a new instance of StockEventArgs. /// </summary> /// <param name="info"> /// StockInfo. /// </param> internal StockEventArgs(StockInfo info) { StockInfo = info ?? throw new ArgumentNullException(nameof(info) + "must not be null"); }
private void Update(object sender, StockInfo stockInfo) { Console.WriteLine(stockInfo.USD > 30 ? $"Broker {this.Name} sells dollars; Dollar rate: {stockInfo.USD}" : $"Broker {this.Name} buys dollars; Dollar rate: {stockInfo.USD}"); }
public void Update(object info, IEventStock eventStock) { StockInfo stockInfo = (StockInfo)info; eventStock.eventStock += Update; }