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

                    _source.Processing += OnProcessing;
                }
Beispiel #2
0
 private void UnSubscribe(ICandleSource <Candle> source)
 {
     lock (_info.SyncRoot)
     {
         var info = _info[source];
         info.Dispose();
         _info.Remove(source);
     }
 }
Beispiel #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;
                }
Beispiel #4
0
 protected override void OnAdded(ICandleSource <Candle> item)
 {
     Subscribe(item);
     base.OnAdded(item);
 }
Beispiel #5
0
 private void Subscribe(ICandleSource <Candle> source)
 {
     _info.Add(source, new SourceInfo(source, _manager));
 }
Beispiel #6
0
 protected override void OnInserted(int index, ICandleSource <Candle> item)
 {
     Subscribe(item);
     base.OnInserted(index, item);
 }
Beispiel #7
0
 protected override bool OnRemoving(ICandleSource <Candle> item)
 {
     UnSubscribe(item);
     return(base.OnRemoving(item));
 }