Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
            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( );
                }
            }
Ejemplo n.º 4
0
 private void RaiseChangedEvent()
 {
     Changed?.BeginInvoke(this, EventArgs.Empty, null, null);
 }
Ejemplo n.º 5
0
 private void RaiseChangedEvent(FilterType fromType, FilterType toType)
 {
     Changed?.BeginInvoke(this, new ChangedEventArgs(fromType, toType), null, null);
 }