我创建了简单的工厂:
public interface ICommandFactory
{
ICommand CreateCommand(string componentName);
}
使用Windsor的Typed Factory功能实现:
Container.AddFacility<TypedFactoryFacility>();
Container.Kernel.Register(Component.For<ICommandFactory>().AsFactory());
我也在使用subresolver:
Container.Kernel.Resolver.AddSubResolver(new CommandResolverByName(Container.Kernel, null));
不幸的是,当我尝试为我的界面使用类型工厂时,它不使用自定义子解析器。 有没有人知道这个问题,或者只是打字工厂的工作方式:&gt;
提前致谢
Jakub
答案 0 :(得分:1)
版本2.5。