示例#1
0
        public ProviderTypeLookup(ILoggerFactory loggerFactory)
        {
            this.lookup = new Dictionary <string, Type>();
            var logger = loggerFactory.CreateLogger <LoadedProviderTypeLoaders>();
            var loader = new LoadedProviderTypeLoaders(logger);

            ProviderTypeLoader.AddProviderTypeManager(t => typeof(IProvider).IsAssignableFrom(t), RegisterProviderType, loader, loggerFactory);
        }
示例#2
0
        public void LoadProviders(IDictionary <string, IProviderConfiguration> configs, IProviderManager providerManager)
        {
            providerConfigs = configs ?? new Dictionary <string, IProviderConfiguration>();

            foreach (var provider in providerConfigs.Values)
            {
                ((ProviderConfiguration)provider).SetProviderManager(providerManager);
            }

            // Load providers
            ProviderTypeLoader.AddProviderTypeManager(t => typeof(TProvider).IsAssignableFrom(t), RegisterProviderType);
            ValidateProviders();
        }