castle-windsor Interceptors Creating custom interceptors


Example

Interceptors require the IInterceptor interface. Any public method within the intercepted class will be intercepted (including getters and setters)

public class MyInterceptor : IInterceptor
{
    public void Intercept(IInvocation invocation)
    {
       //Calls the next method in the chain - The last one will be the 
       //original method that was intercepted
       invocation.Proceed();
    }
}

Read this for information about registering an interceptor to components