Beispiel #1
0
        public Plugin AddPlugin(Type pluggedType)
        {
            assertPluggability(pluggedType);

            Plugin plugin = PluginCache.GetPlugin(pluggedType);

            _pluggedTypes[plugin.ConcreteKey] = plugin;

            return(plugin);
        }
Beispiel #2
0
        public Plugin AddPlugin(Type pluggedType, string key)
        {
            assertPluggability(pluggedType);

            Plugin plugin = PluginCache.GetPlugin(pluggedType);

            _pluggedTypes[key] = plugin;

            return(plugin);
        }
Beispiel #3
0
        public void Seal()
        {
            _mementoList.ForEach(memento => _parent.Log.Try(() =>
            {
                Instance instance = memento.ReadInstance(Parent, _pluginType);
                AddInstance(instance);
            }).AndLogAnyErrors());

            discoverImplicitInstances();

            validatePluggabilityOfInstances();

            if (_pluginType.IsConcrete() && PluginCache.GetPlugin(_pluginType).CanBeAutoFilled)
            {
                MissingInstance = new ConfiguredInstance(_pluginType);
            }


            if (_instances.Count == 1)
            {
                _defaultKey = _instances.First.Name;
            }
        }