Exemplo n.º 1
0
        //[DebuggerStepThrough]
        ////[DebuggerHidden]
        public MethodConcernsInstance NewInstance(ModuleInstance moduleInstance, FragmentInvocationHandler mixinInvocationHandler)
        {
            var    proxyHandler = new ProxyReferenceInvocationHandler();
            object nextConcern  = mixinInvocationHandler;

            for (int i = this.concernsForMethod.Count - 1; i >= 0; i--)
            {
                MethodConcernModel concernModel = this.concernsForMethod[i];

                nextConcern = concernModel.NewInstance(moduleInstance, nextConcern, proxyHandler);
            }

            InvocationHandler firstConcern;

            if (nextConcern is InvocationHandler)
            {
                firstConcern = (InvocationHandler)nextConcern;
            }
            else
            {
                firstConcern = new TypedFragmentInvocationHandler(nextConcern);
            }

            return(new MethodConcernsInstance(firstConcern, mixinInvocationHandler, proxyHandler));
        }
Exemplo n.º 2
0
        //[DebuggerStepThrough]
        ////[DebuggerHidden]
        public MethodConcernsInstance NewInstance(ModuleInstance moduleInstance, FragmentInvocationHandler mixinInvocationHandler)
        {
            var proxyHandler = new ProxyReferenceInvocationHandler();
            object nextConcern = mixinInvocationHandler;
            for (int i = this.concernsForMethod.Count - 1; i >= 0; i--)
            {
                MethodConcernModel concernModel = this.concernsForMethod[i];

                nextConcern = concernModel.NewInstance(moduleInstance, nextConcern, proxyHandler);
            }

            InvocationHandler firstConcern;
            if (nextConcern is InvocationHandler)
            {
                firstConcern = (InvocationHandler)nextConcern;
            }
            else
            {
                firstConcern = new TypedFragmentInvocationHandler(nextConcern);
            }

            return new MethodConcernsInstance(firstConcern, mixinInvocationHandler, proxyHandler);
        }