List all IRegistrations in WindsorContainer/Kernel

别来无恙 提交于 2019-12-11 10:36:47

问题


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:


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.



来源:https://stackoverflow.com/questions/2951989/list-all-iregistrations-in-windsorcontainer-kernel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!