Exemple #1
0
        private ReferenceInterceptor GetReferenceInterceptor()
        {
            if (this.defaultReferenceInterceptor == null)
            {
                this.defaultReferenceInterceptor = new ReferenceInterceptor();
            }

            this.defaultReferenceInterceptor.Cancel      = false;
            this.defaultReferenceInterceptor.Replacement = null;
            return(this.defaultReferenceInterceptor);
        }
Exemple #2
0
        public IReferenceInterceptor OnReference(IAbstractEmitterBlock block, MemberReferenceExpression expression, MemberResolveResult resolveResult)
        {
            ReferenceInterceptor interceptor = this.GetReferenceInterceptor();

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

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

            return(interceptor);
        }