예제 #1
0
        private InvocationInterceptor GetInvocationInterceptor()
        {
            if (this.defaultInvocationInterceptor == null)
            {
                this.defaultInvocationInterceptor = new InvocationInterceptor();
            }

            this.defaultInvocationInterceptor.Cancel      = false;
            this.defaultInvocationInterceptor.Replacement = null;
            return(this.defaultInvocationInterceptor);
        }
예제 #2
0
        public IInvocationInterceptor OnInvocation(IAbstractEmitterBlock block, InvocationExpression expression, InvocationResolveResult resolveResult)
        {
            InvocationInterceptor interceptor = this.GetInvocationInterceptor();

            interceptor.Block         = block;
            interceptor.Expression    = expression;
            interceptor.ResolveResult = resolveResult;

            foreach (var plugin in this.Parts)
            {
                plugin.OnInvocation(interceptor);
                if (interceptor.Cancel)
                {
                    return(interceptor);
                }
            }

            return(interceptor);
        }