public void UpdateView(bool charger) { if ((IsCharging && charger) || (!IsCharging)) { var arg = new BatteryModelEventArgs { ChargeLevelInt = this.ChargeLevel, IsCharging = this.IsCharging, }; Changed?.BeginInvoke(this, arg, null, null); } }
public void UpdateView() { List <Message> temp; lock (LockMsgTextList) { temp = new List <Message>(MsgTextListGet); } if (temp != null) { IEnumerable <Message> messages = Filter(temp); Changed?.BeginInvoke(this, new ModelEventArgs((List <Message>)messages.ToList()), null, null); } }
public void Process(CryptoCoin coin) { if (!LastSignificantPrice.ContainsKey(coin.Symbol)) { LastSignificantPrice[coin.Symbol] = coin.Clone( ); } var change = coin - LastSignificantPrice[coin.Symbol]; var percentage = Math.Abs(change.Percentage); if (percentage >= Threshold) { Changed?.BeginInvoke(Exchange, LastSignificantPrice[coin.Symbol], coin, null, null); LastSignificantPrice[coin.Symbol] = coin.Clone( ); } }
private void RaiseChangedEvent() { Changed?.BeginInvoke(this, EventArgs.Empty, null, null); }
private void RaiseChangedEvent(FilterType fromType, FilterType toType) { Changed?.BeginInvoke(this, new ChangedEventArgs(fromType, toType), null, null); }