Example #1
0
 public static IRegistrationBuilder <TLimit, ScanningActivatorData, TRegistrationStyle> EnableDynamicProxy <TLimit, TRegistrationStyle>(
     this IRegistrationBuilder <TLimit, ScanningActivatorData, TRegistrationStyle> rb,
     DynamicProxyContext dynamicProxyContext)
 {
     rb.ActivatorData.ConfigurationActions.Add((t, rb2) => rb2.EnableDynamicProxy(dynamicProxyContext));
     return(rb);
 }
Example #2
0
        public static IRegistrationBuilder <TLimit, TConcreteReflectionActivatorData, TRegistrationStyle> EnableDynamicProxy <TLimit, TConcreteReflectionActivatorData, TRegistrationStyle>(
            this IRegistrationBuilder <TLimit, TConcreteReflectionActivatorData, TRegistrationStyle> rb,
            DynamicProxyContext dynamicProxyContext)
            where TConcreteReflectionActivatorData : ConcreteReflectionActivatorData
        {
            dynamicProxyContext.EnableDynamicProxy(rb);

            return(rb);
        }
Example #3
0
        public static void InterceptedBy <TService>(this IComponentRegistration cr)
        {
            var dynamicProxyContext = DynamicProxyContext.From(cr);

            if (dynamicProxyContext == null)
            {
                throw new ApplicationException(string.Format("Component {0} was not registered with EnableDynamicProxy", cr.Activator.LimitType));
            }

            dynamicProxyContext.AddInterceptorService(cr, new TypedService(typeof(TService)));
        }
Example #4
0
 public ConstructorFinderWrapper(IConstructorFinder constructorFinder, DynamicProxyContext dynamicProxyContext)
 {
     _constructorFinder   = constructorFinder;
     _dynamicProxyContext = dynamicProxyContext;
 }