示例#1
0
        private void UpdateServices()
        {
            this._services = new List <IStockQuoteService>();

            foreach (var item in _settings)
            {
                IStockQuoteService service = null;
                if (AlphaVantage.IsMySettings(item))
                {
                    service = new AlphaVantage(item, this.LogPath);
                }
                else if (IEXTrading.IsMySettings(item))
                {
                    service = new IEXTrading(item, this.LogPath);
                }

                if (service != null)
                {
                    service.DownloadError  += OnServiceDownloadError;
                    service.QuoteAvailable += OnServiceQuoteAvailable;
                    service.Complete       += OnServiceQuotesComplete;
                    service.Suspended      += OnServiceSuspended;
                    service.SymbolNotFound += OnSymbolNotFound;
                    this._services.Add(service);
                }
            }
        }
示例#2
0
        public List <StockServiceSettings> GetDefaultSettingsList()
        {
            List <StockServiceSettings> result = new List <StockServiceSettings>();

            result.Add(IEXTrading.GetDefaultSettings());
            result.Add(AlphaVantage.GetDefaultSettings());
            return(result);
        }