/// <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;
            }
        }
        /// <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);
        }
        /// <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);
        }
 /// <summary>
 /// Instantiates a <see cref="CsvColumnProviderFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public CsvColumnProviderFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
示例#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)
 {
 }
示例#6
0
 /// <summary>
 /// Instantiates a <see cref="YqlPropertyMapperFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public YqlPropertyMapperFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
        /// <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;
            }
        }
示例#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)
 {
 }
示例#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)
 {
 }
示例#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)
 {
 }
 /// <summary>
 /// Instantiates a <see cref="CsvColumnProviderFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public CsvColumnProviderFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
 /// <summary>
 /// Instantiates a <see cref="YqlPropertyMapperFactory"/>
 /// </summary>
 /// <param name="assemblyConfigurationManager"></param>
 public YqlPropertyMapperFactory(IAssemblyConfigurationManager assemblyConfigurationManager)
 {
     _assemblyConfigurationManager = assemblyConfigurationManager;
 }
示例#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;
 }