2010-12-17 68 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