Ejemplo 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));
        }
Ejemplo n.º 2
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodSideEffectsInstance(IList <InvocationHandler> sideEffects, SideEffectInvocationHandlerResult resultInvocationHandler, ProxyReferenceInvocationHandler proxyHandler, InvocationHandler invoker)
 {
     this.sideEffects             = sideEffects;
     this.resultInvocationHandler = resultInvocationHandler;
     this.proxyHandler            = proxyHandler;
     this.invoker = invoker;
 }
Ejemplo n.º 3
0
        // Context
        //[DebuggerStepThrough]
        ////[DebuggerHidden]
        public object NewInstance(ModuleInstance moduleInstance, object next, ProxyReferenceInvocationHandler proxyHandler)
        {
            var    injectionContext = new InjectionContext(moduleInstance, this.WrapNext(next), proxyHandler);
            object mixin            = this.injectedObjectBuilder.NewInstance(injectionContext);

            return(mixin);
        }
Ejemplo n.º 4
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodSideEffectsInstance(IList<InvocationHandler> sideEffects, SideEffectInvocationHandlerResult resultInvocationHandler, ProxyReferenceInvocationHandler proxyHandler, InvocationHandler invoker)
 {
     this.sideEffects = sideEffects;
     this.resultInvocationHandler = resultInvocationHandler;
     this.proxyHandler = proxyHandler;
     this.invoker = invoker;
 }
Ejemplo n.º 5
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodSideEffectsInstance NewInstance(ModuleInstance moduleInstance, InvocationHandler invoker)
 {
     var proxyHandler = new ProxyReferenceInvocationHandler();
     var result = new SideEffectInvocationHandlerResult();
     var sideEffects = new List<InvocationHandler>(this.sideEffectModels.Count);
     foreach (MethodSideEffectModel sideEffectModel in this.sideEffectModels)
     {
         object sideEffect = sideEffectModel.NewInstance(moduleInstance, result, proxyHandler);
         if (sideEffectModel.IsGeneric)
         {
             sideEffects.Add((InvocationHandler)sideEffect);
         }
         else
         {
             sideEffects.Add(new TypedFragmentInvocationHandler(sideEffect));
         }
     }
     return new MethodSideEffectsInstance(sideEffects, result, proxyHandler, invoker);
 }
Ejemplo n.º 6
0
        //[DebuggerStepThrough]
        ////[DebuggerHidden]
        public MethodSideEffectsInstance NewInstance(ModuleInstance moduleInstance, InvocationHandler invoker)
        {
            var proxyHandler = new ProxyReferenceInvocationHandler();
            var result       = new SideEffectInvocationHandlerResult();
            var sideEffects  = new List <InvocationHandler>(this.sideEffectModels.Count);

            foreach (MethodSideEffectModel sideEffectModel in this.sideEffectModels)
            {
                object sideEffect = sideEffectModel.NewInstance(moduleInstance, result, proxyHandler);
                if (sideEffectModel.IsGeneric)
                {
                    sideEffects.Add((InvocationHandler)sideEffect);
                }
                else
                {
                    sideEffects.Add(new TypedFragmentInvocationHandler(sideEffect));
                }
            }
            return(new MethodSideEffectsInstance(sideEffects, result, proxyHandler, invoker));
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodConcernsInstance(InvocationHandler firstConcern, FragmentInvocationHandler mixinInvocationHandler, ProxyReferenceInvocationHandler proxyHandler)
 {
     this.firstConcern           = firstConcern;
     this.mixinInvocationHandler = mixinInvocationHandler;
     this.proxyHandler           = proxyHandler;
 }
Ejemplo n.º 9
0
 // Context
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public object NewInstance(ModuleInstance moduleInstance, object next, ProxyReferenceInvocationHandler proxyHandler)
 {
     var injectionContext = new InjectionContext(moduleInstance, this.WrapNext(next), proxyHandler);
     object mixin = this.injectedObjectBuilder.NewInstance(injectionContext);
     return mixin;
 }
Ejemplo n.º 10
0
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodConcernsInstance(InvocationHandler firstConcern, FragmentInvocationHandler mixinInvocationHandler, ProxyReferenceInvocationHandler proxyHandler)
 {
     this.firstConcern = firstConcern;
     this.mixinInvocationHandler = mixinInvocationHandler;
     this.proxyHandler = proxyHandler;
 }