/// <summary> /// Gets the property mapper /// </summary> /// <returns></returns> public IYqlPropertyMapper GetPropertyMapper() { // get the config for the assembly var assemblyConfig = _assemblyConfigurationManager.GetAssemblyConfiguration(GetType()); // return the config section return(assemblyConfig.CustomSections.FirstOrDefault(c => c.GetType() == typeof(YqlQueryConfigurationSection)) as YqlQueryConfigurationSection); }
/// <summary> /// Gets a CSV column provider /// </summary> /// <returns></returns> public ICsvColumnProvider GetColumnProvider() { // get the config for the assembly var assemblyConfig = _assemblyConfigurationManager.GetAssemblyConfiguration(GetType()); // return the config section return(assemblyConfig.CustomSections.FirstOrDefault(c => c.GetType() == typeof(CsvQueryConfigurationSection)) as CsvQueryConfigurationSection); }
/// <summary> /// Initializes the module from configuration /// </summary> public virtual void Initialize() { // get the configuration for the assembly var assemblyConfiguration = _assemblyConfigurationManager.GetAssemblyConfiguration(GetType().Assembly); // add registrations to container if (assemblyConfiguration != null) assemblyConfiguration.Registrations.AddRegistrationsToContainer(_container); }
/// <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="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 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; } }