Esempio n. 1
0
                public SourceInfo(ICandleSource <Candle> source, CandleManager manager)
                {
                    _source  = source ?? throw new ArgumentNullException(nameof(source));
                    _manager = manager;

                    _source.Processing += OnProcessing;
                }
Esempio n. 2
0
 private void UnSubscribe(ICandleSource <Candle> source)
 {
     lock (_info.SyncRoot)
     {
         var info = _info[source];
         info.Dispose();
         _info.Remove(source);
     }
 }
Esempio n. 3
0
                public SourceInfo(ICandleSource <Candle> source, CandleManager manager)
                {
                    if (source == null)
                    {
                        throw new ArgumentNullException(nameof(source));
                    }

                    _source  = source;
                    _manager = manager;

                    _source.Processing += OnProcessing;
                    _source.Error      += _manager.RaiseError;
                }
Esempio n. 4
0
 protected override void OnAdded(ICandleSource <Candle> item)
 {
     Subscribe(item);
     base.OnAdded(item);
 }
Esempio n. 5
0
 private void Subscribe(ICandleSource <Candle> source)
 {
     _info.Add(source, new SourceInfo(source, _manager));
 }
Esempio n. 6
0
 protected override void OnInserted(int index, ICandleSource <Candle> item)
 {
     Subscribe(item);
     base.OnInserted(index, item);
 }
Esempio n. 7
0
 protected override bool OnRemoving(ICandleSource <Candle> item)
 {
     UnSubscribe(item);
     return(base.OnRemoving(item));
 }