//[DebuggerStepThrough] ////[DebuggerHidden] public CompositeMethodInstance(InvocationHandler invoker, FragmentInvocationHandler handler, MethodInfo method, int mixinIndex) { this.invoker = invoker; this.mixinInvoker = handler; this.method = method; this.mixinIndex = mixinIndex; }
//[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)); }
//[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()])); }
//[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); }
//[DebuggerStepThrough] ////[DebuggerHidden] public MethodConcernsInstance(InvocationHandler firstConcern, FragmentInvocationHandler mixinInvocationHandler, ProxyReferenceInvocationHandler proxyHandler) { this.firstConcern = firstConcern; this.mixinInvocationHandler = mixinInvocationHandler; this.proxyHandler = proxyHandler; }