private void StockPriceChanged(object sender, PriceChangedEventArgs e) { if (e.LastPrice == 0) { if (e.NewPrice > 0) { MessageBox.Show("Just increase!"); } else if (e.NewPrice < 0) { MessageBox.Show("Just decrease!"); } // Need decimal zero equal judegement. else { MessageBox.Show("Just Zero!"); } } else if (((e.NewPrice - e.LastPrice) / e.LastPrice) > 0.1M) { MessageBox.Show("Alert, 10% stock price increase!"); } }
protected virtual void OnPriceChanged(PriceChangedEventArgs e) { PriceChanged?.Invoke(this, e); }