Exemplo n.º 1
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public CompositeMethodInstance(InvocationHandler invoker, FragmentInvocationHandler handler, MethodInfo method, int mixinIndex)
 {
     this.invoker      = invoker;
     this.mixinInvoker = handler;
     this.method       = method;
     this.mixinIndex   = mixinIndex;
 }
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));
        }
Exemplo n.º 3
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public CompositeMethodInstance(InvocationHandler invoker, FragmentInvocationHandler handler, MethodInfo method, int mixinIndex)
 {
     this.invoker = invoker;
     this.mixinInvoker = handler;
     this.method = method;
     this.mixinIndex = mixinIndex;
 }
Exemplo n.º 4
0
        //[DebuggerStepThrough]
        ////[DebuggerHidden]
        private CompositeMethodInstance NewCompositeMethodInstance(MethodInfo genericMethod, ModuleInstance moduleInstance)
        {
            FragmentInvocationHandler mixinInvocationHandler = this.mixins.NewInvocationHandler(genericMethod);
            InvocationHandler         invoker = mixinInvocationHandler;

            if (this.methodConcerns.HasConcerns)
            {
                MethodConcernsInstance concernsInstance = this.methodConcerns.NewInstance(moduleInstance, mixinInvocationHandler);
                invoker = concernsInstance;
            }
            if (this.methodSideEffects.HasSideEffects)
            {
                MethodSideEffectsInstance sideEffectsInstance = this.methodSideEffects.NewInstance(moduleInstance, invoker);
                invoker = sideEffectsInstance;
            }

            return(new CompositeMethodInstance(invoker, mixinInvocationHandler, genericMethod, this.mixins.MethodIndex[genericMethod.ToDefinition()]));
        }
Exemplo n.º 5
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.º 6
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodConcernsInstance(InvocationHandler firstConcern, FragmentInvocationHandler mixinInvocationHandler, ProxyReferenceInvocationHandler proxyHandler)
 {
     this.firstConcern           = firstConcern;
     this.mixinInvocationHandler = mixinInvocationHandler;
     this.proxyHandler           = proxyHandler;
 }
Exemplo n.º 7
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodConcernsInstance(InvocationHandler firstConcern, FragmentInvocationHandler mixinInvocationHandler, ProxyReferenceInvocationHandler proxyHandler)
 {
     this.firstConcern = firstConcern;
     this.mixinInvocationHandler = mixinInvocationHandler;
     this.proxyHandler = proxyHandler;
 }