示例#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);
        }
示例#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;
 }