public void Intercept(IInvocation invocation) { var invokeBefore = new InvokeWithInvocation(callBinder); invokeBefore.Intercept(invocation); var invokeCall = new InvokeOriginalCall(); invokeCall.Intercept(invocation); }
public void Intercept(IInvocation invocation) { var wasIntercepted = false; foreach (var interceptor in InterceptorRegistry.GetInterceptors()) { if (interceptor.ShouldIntercept(originalInvocation)) { interceptor.Intercept(invocation); wasIntercepted = true; } } if (!wasIntercepted) { var callOriginal = new InvokeOriginalCall(); callOriginal.Intercept(invocation); } }