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

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