Ejemplo n.º 1
0
        private IInterceptorCreationStrategy ResolveHowToCreateInterceptor(AspectRegistration aspectRegistration)
        {
            IInterceptorCreationStrategy strategy;

            if (Container == null)
            {
                // when container is not specified, always use InstantiateInterceptorDirectlyCreationStrategy
                // without considering AspectRegistration.KeptInContainer setting
                strategy = new InstantiateInterceptorDirectlyCreationStrategy();
            }
            else if (aspectRegistration.KeptInContainer)
            {
                strategy = new ResolveInterceptorFromContainerCreationStrategy(Container);
            }
            else
            {
                strategy = new InstantiateInterceptorDirectlyCreationStrategy();
            }
            return(strategy);
        }
Ejemplo n.º 2
0
 private IInterceptorCreationStrategy ResolveHowToCreateInterceptor(AspectRegistration aspectRegistration)
 {
     IInterceptorCreationStrategy strategy;
     if(Container == null)
     {
         // when container is not specified, always use InstantiateInterceptorDirectlyCreationStrategy
         // without considering AspectRegistration.KeptInContainer setting
         strategy = new InstantiateInterceptorDirectlyCreationStrategy();
     }
     else if (aspectRegistration.KeptInContainer)
     {
         strategy = new ResolveInterceptorFromContainerCreationStrategy(Container);
     }
     else
     {
         strategy = new InstantiateInterceptorDirectlyCreationStrategy();
     }
     return strategy;
 }