Beispiel #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));
        }
Beispiel #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;
 }
Beispiel #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);
        }
 //[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;
 }
 //[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);
 }
        //[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));
        }
        //[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;
 }
 // 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;
 }
 //[DebuggerStepThrough]
 ////[DebuggerHidden]
 public MethodConcernsInstance(InvocationHandler firstConcern, FragmentInvocationHandler mixinInvocationHandler, ProxyReferenceInvocationHandler proxyHandler)
 {
     this.firstConcern = firstConcern;
     this.mixinInvocationHandler = mixinInvocationHandler;
     this.proxyHandler = proxyHandler;
 }