2010-12-17 69 views

回答

1

使用.First.Last.AtIndex()以声明的时候拦截参考,例如:

container.Register(
    Component.For<ISomething>() 
    .ImplementedBy<Something>() 
    .Interceptors(InterceptorReference.ForKey("myinterceptor")).Last); 

控制拦截器的顺序或者使用.Anywhere,如果你不关心排序。

+0

或者如果你需要更多的动态控制(我从你的问题推断你没有),你可以使用'IInterceptorsSelector' – 2010-12-17 14:05:11

+0

添加到文档:http://stw.castleproject.org/Windsor.Registering-Interceptors- ProxyOptions.ashx?NS =温莎#Ordering_interceptors_1 – 2010-12-17 14:20:04