Esempio n. 1
0
        public void ChangeRate()
        {
            Random rnd = new Random();

            USD  = rnd.Next(20, 40);
            Euro = rnd.Next(30, 50);
            RateChanged?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 2
0
        public void PublishRate(Rate rate)
        {
            if (rate == null)
            {
                foreach (var observer in _observers)
                {
                    observer.OnCompleted();
                }
                rates.Clear();
                return;
            }
            rates[rate.Ticker] = rate;

            RateChanged?.Invoke(this, new RateChangedArgs(rate));

            foreach (var observer in _observers)
            {
                observer.OnNext(rate);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Raises the <see cref="E:ValueChanged" /> event.
 /// </summary>
 /// <param name="e">The <see cref="Events.RateChangedEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRateChanged(Events.RateChangedEventArgs e)
 {
     RateChanged?.Invoke(this, e);
 }