Beispiel #1
0
        public static void AddProviderTypeManager(Func <Type, bool> condition, Action <Type> action, LoadedProviderTypeLoaders loadedProviderTypeLoadersSingleton, ILoggerFactory loggerFactory)
        {
            var manager = new ProviderTypeLoader(condition, action, loggerFactory);

            loadedProviderTypeLoadersSingleton.Managers.Add(manager);
            manager.ProcessLoadedAssemblies(loadedProviderTypeLoadersSingleton);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public static void AddProviderTypeManager(Func<Type, bool> condition, Action<Type> action)
        {
            var manager = new ProviderTypeLoader(condition, action);

            lock (managers)
            {
                managers.Add(manager);
            }

            manager.ProcessLoadedAssemblies();
        }
Beispiel #4
0
        public static void AddProviderTypeManager(Func <Type, bool> condition, Action <Type> action)
        {
            var manager = new ProviderTypeLoader(condition, action);

            lock (managers)
            {
                managers.Add(manager);
            }

            manager.ProcessLoadedAssemblies();
        }
Beispiel #5
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();
        }