コード例 #1
0
    public static InstanceFactory CreateFactoryForFamily(PluginFamily family, ProfileManager profileManager)
    {
        family.Seal();

            var factory = new InstanceFactory(family);

            Instance instance = family.GetDefaultInstance();
            if(instance != null) {
                profileManager.SetDefault(family.PluginType, instance);
            }

            return factory;
    }
コード例 #2
0
    public IInstanceFactory Clone()
    {
        var factory = new InstanceFactory(_pluginType);

            factory.MissingInstance = MissingInstance;
            factory._lifecycle = _lifecycle;
            factory._instances = _instances.Clone();

            return factory;
    }
コード例 #3
0
 protected void registerFactory(Type pluginType, InstanceFactory factory)
 {
     _factories.Add(pluginType, factory);
 }