List all IRegistrations in WindsorContainer/Kernel

2019-07-30 14:08发布

How do I get a list of all IRegistrations/ComponentRegistrations in my WindsorContainer or its kernel? I can see a way of doing this by wiring to the ComponentRegistered event and tracking there, but is there an eaiser way?

Thanks.

1条回答
仙女界的扛把子
2楼-- · 2019-07-30 14:27

You can get the handlers from the container, but not the IRegistrations:

IHandler[] handlers = container.Kernel.GetAssignableHandlers(typeof(object));

Handlers are basically the registered components. IHandler.ComponentModel contains most of the information of a registered component.

查看更多
登录 后发表回答