Пример #1
0
        public void Intercept(IInvocation invocation)
        {
            var invokeBefore = new InvokeWithInvocation(callBinder);
            invokeBefore.Intercept(invocation);

            var invokeCall = new InvokeOriginalCall();
            invokeCall.Intercept(invocation);
        }
Пример #2
0
        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);
            }
        }