コード例 #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
ファイル: MasterProxy.cs プロジェクト: nickspoons/Snap
 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;
 }