Ejemplo n.º 1
0
        /// <summary>
        /// Instantiates a <see cref="YahooMarketDataAppSettings"/>
        /// </summary>
        /// <param name="assemblyConfigurationManager"></param>
        public YahooMarketDataAppSettings(IAssemblyConfigurationManager assemblyConfigurationManager)
        {
            // check that the app settings provider is set
            if (assemblyConfigurationManager == null)
            {
                throw new ArgumentNullException("assemblyConfigurationManager");
            }

            var assemblyConfig = assemblyConfigurationManager.GetAssemblyConfiguration(GetType());

            if (assemblyConfig != null)
            {
                // get the format of the yql url
                _yqlUrlFormat = assemblyConfig.Settings.GetSetting(YqlEndpointSettingName, DefaultYqlEndpoint);
                if (string.IsNullOrWhiteSpace(_yqlUrlFormat))
                {
                    throw new EndpointFormatNotFoundException("YQL");
                }

                // get flag indicating whether or not to include diagnostics data in the results of a YQL query
                _yqlIncludeDiagnostics = assemblyConfig.Settings.GetSetting(IncludeDiagnosticsSettingName, true);

                // get flag indicating whether or not to include diagnostics data in the results of a YQL query
                _yqlTableBlockedRegex =
                    assemblyConfig.Settings.GetSetting(YqlTableBlockedMessageSettingName,
                                                       DefaultYqlTableBlockedMessage);

                // get the YQL select for stocks
                _yqlStockSelect =
                    assemblyConfig.Settings.GetSetting(YqlStockSelectSettingName,
                                                       DefaultYqlStockSelectFormat);

                // get the YQL select for quotes
                _yqlMultiStockQuoteSelect =
                    assemblyConfig.Settings.GetSetting(YqlMultiQuoteStockSelectSettingName,
                                                       DefaultYqlMultiStockQuoteSelectFormat);

                // get the format of the csv url
                _csvUrlFormat = assemblyConfig.Settings.GetSetting(CsvEndpointSettingName, DefaultCsvEndpoint);
                if (string.IsNullOrWhiteSpace(_csvUrlFormat))
                {
                    throw new EndpointFormatNotFoundException("CSV");
                }
            }
            else
            {
                // use defaults for all settings
                _yqlUrlFormat          = DefaultYqlEndpoint;
                _yqlIncludeDiagnostics = true;
                _yqlTableBlockedRegex  = DefaultYqlTableBlockedMessage;
                _csvUrlFormat          = DefaultCsvEndpoint;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Instantiates an <see cref="EmailAlertsAppSettings"/>
        /// </summary>
        /// <param name="assemblyConfigurationManager"></param>
        public EmailAlertsAppSettings(IAssemblyConfigurationManager assemblyConfigurationManager)
        {
            // get configuration for this assembly
            var configuration = assemblyConfigurationManager.GetAssemblyConfiguration(GetType());

            // set feed name for PennyPicks
            _pennyPicksFeedName = configuration.Settings.GetSetting(PennyPicksFeedNameKey, DefaultPennyPicksFeedName);

            // set stock data provider name for PennyPicks
            _pennyPicksStockDataProviderName =
                configuration.Settings.GetSetting(PennyPicksStockDataProviderNameKey, DefaultPennyPicksStockDataProviderName);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Instantiates an <see cref="EmailAlertsAppSettings"/>
        /// </summary>
        /// <param name="assemblyConfigurationManager"></param>
        public EmailAlertsAppSettings(IAssemblyConfigurationManager assemblyConfigurationManager)
        {
            // get configuration for this assembly
            var configuration = assemblyConfigurationManager.GetAssemblyConfiguration(GetType());

            // set feed name for PennyPicks
            _pennyPicksFeedName = configuration.Settings.GetSetting(PennyPicksFeedNameKey, DefaultPennyPicksFeedName);

            // set stock data provider name for PennyPicks
            _pennyPicksStockDataProviderName =
                configuration.Settings.GetSetting(PennyPicksStockDataProviderNameKey, DefaultPennyPicksStockDataProviderName);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Instantiates a <see cref="CsvColumnProviderFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public CsvColumnProviderFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Instantiates a <see cref="EmailAlertsModule"/>
 /// </summary>
 /// <param name="container"></param>
 /// <param name="assemblyConfigurationManager"></param>
 public EmailAlertsModule(IUnityContainer container,
                          IAssemblyConfigurationManager assemblyConfigurationManager)
     : base(container, assemblyConfigurationManager)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Instantiates a <see cref="YqlPropertyMapperFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public YqlPropertyMapperFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Instantiates a <see cref="YahooMarketDataAppSettings"/>
        /// </summary>
        /// <param name="assemblyConfigurationManager"></param>
        public YahooMarketDataAppSettings(IAssemblyConfigurationManager assemblyConfigurationManager)
        {
            // check that the app settings provider is set
            if (assemblyConfigurationManager == null)
                throw new ArgumentNullException("assemblyConfigurationManager");

            var assemblyConfig = assemblyConfigurationManager.GetAssemblyConfiguration(GetType());
            if (assemblyConfig != null)
            {
                // get the format of the yql url
                _yqlUrlFormat = assemblyConfig.Settings.GetSetting(YqlEndpointSettingName, DefaultYqlEndpoint);
                if (string.IsNullOrWhiteSpace(_yqlUrlFormat))
                    throw new EndpointFormatNotFoundException("YQL");

                // get flag indicating whether or not to include diagnostics data in the results of a YQL query
                _yqlIncludeDiagnostics = assemblyConfig.Settings.GetSetting(IncludeDiagnosticsSettingName, true);

                // get flag indicating whether or not to include diagnostics data in the results of a YQL query
                _yqlTableBlockedRegex =
                    assemblyConfig.Settings.GetSetting(YqlTableBlockedMessageSettingName,
                                                       DefaultYqlTableBlockedMessage);

                // get the YQL select for stocks
                _yqlStockSelect =
                    assemblyConfig.Settings.GetSetting(YqlStockSelectSettingName,
                                                       DefaultYqlStockSelectFormat);

                // get the YQL select for quotes
                _yqlMultiStockQuoteSelect =
                    assemblyConfig.Settings.GetSetting(YqlMultiQuoteStockSelectSettingName,
                                                       DefaultYqlMultiStockQuoteSelectFormat);

                // get the format of the csv url
                _csvUrlFormat = assemblyConfig.Settings.GetSetting(CsvEndpointSettingName, DefaultCsvEndpoint);
                if (string.IsNullOrWhiteSpace(_csvUrlFormat))
                    throw new EndpointFormatNotFoundException("CSV");
            }
            else
            {
                // use defaults for all settings
                _yqlUrlFormat = DefaultYqlEndpoint;
                _yqlIncludeDiagnostics = true;
                _yqlTableBlockedRegex = DefaultYqlTableBlockedMessage;
                _csvUrlFormat = DefaultCsvEndpoint;
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Instantiates a <see cref="YahooMarketDataModule"/>
 /// </summary>
 /// <param name="container"></param>
 /// <param name="assemblyConfigurationManager"></param>
 public YahooMarketDataModule(IUnityContainer container,
                              IAssemblyConfigurationManager assemblyConfigurationManager)
     : base(container, assemblyConfigurationManager)
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Instantiates a <see cref="EmailAlertsModule"/>
 /// </summary>
 /// <param name="container"></param>
 /// <param name="assemblyConfigurationManager"></param>
 public EmailAlertsModule(IUnityContainer container,
                          IAssemblyConfigurationManager assemblyConfigurationManager)
     : base(container, assemblyConfigurationManager)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Instantiates a <see cref="YahooMarketDataModule"/>
 /// </summary>
 /// <param name="container"></param>
 /// <param name="assemblyConfigurationManager"></param>
 public YahooMarketDataModule(IUnityContainer container,
     IAssemblyConfigurationManager assemblyConfigurationManager)
     : base(container, assemblyConfigurationManager)
 {
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Instantiates a <see cref="CsvColumnProviderFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public CsvColumnProviderFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Instantiates a <see cref="YqlPropertyMapperFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public YqlPropertyMapperFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Instantiates a <see cref="ConfigurableModule"/>
 /// </summary>
 /// <param name="container"></param>
 /// <param name="assemblyConfigurationManager"></param>
 protected ConfigurableModule(IUnityContainer container, IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
     _container = container;
 }