public static void CreateFactory <TPluginType>(this CreatePluginFamilyExpression <TPluginType> expression,
                                                       IAutoFactoryConventionProvider conventionProvider)
            where TPluginType : class
        {
            var callback = CreateFactoryCallback <TPluginType>(conventionProvider);

            expression.Use(GetDescription <TPluginType>(), callback);
        }
 public FactoryInterceptor(IContainer container, IAutoFactoryConventionProvider conventionProvider)
 {
     _container          = container;
     _conventionProvider = conventionProvider;
 }
Пример #3
0
 public ProxyFactory(ProxyGenerator proxyGenerator, IContext context, IAutoFactoryConventionProvider conventionProvider)
 {
     _proxyGenerator     = proxyGenerator;
     _context            = context;
     _conventionProvider = conventionProvider;
 }
Пример #4
0
 public FactoryInterceptor(IContainer container, IAutoFactoryConventionProvider conventionProvider)
 {
     _container = container;
     _conventionProvider = conventionProvider;
 }
        private static Func <IContext, TPluginType> CreateFactoryCallback <TPluginType>(IAutoFactoryConventionProvider conventionProvider)
            where TPluginType : class
        {
            return(ctxt =>
            {
                var proxyFactory = new ProxyFactory <TPluginType>(proxyGenerator, ctxt, conventionProvider);

                return proxyFactory.Create();
            });
        }