示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyFactory"/> class.
        /// </summary>
        /// <param name="typeBuilderFactory">The type builder factory.</param>
        /// <param name="interceptionFilter">The interception filter.</param>
        internal ProxyFactory(ITypeBuilderFactory typeBuilderFactory, IInterceptionFilter interceptionFilter)
        {
            if (typeBuilderFactory == null)
                throw new ArgumentNullException("typeBuilderFactory");

            if (interceptionFilter == null)
                throw new ArgumentNullException("interceptionFilter");

            _typeBuilderFactory = typeBuilderFactory;
            _interceptionFilter = interceptionFilter;

            _proxyTemplateCache = new LockOnWriteCache<IProxyDefinition, IProxyTemplate>();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyFactory"/> class.
        /// </summary>
        /// <param name="typeBuilderFactory">The type builder factory.</param>
        /// <param name="interceptionFilter">The interception filter.</param>
        internal ProxyFactory(ITypeBuilderFactory typeBuilderFactory, IInterceptionFilter interceptionFilter)
        {
            if (typeBuilderFactory == null)
            {
                throw new ArgumentNullException("typeBuilderFactory");
            }

            if (interceptionFilter == null)
            {
                throw new ArgumentNullException("interceptionFilter");
            }

            _typeBuilderFactory = typeBuilderFactory;
            _interceptionFilter = interceptionFilter;

            _proxyTemplateCache = new LockOnWriteCache <IProxyDefinition, IProxyTemplate>();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AutoFactoryBuilder"/> class.
 /// </summary>
 /// <param name="typeBuilderFactory">The <see cref="ITypeBuilderFactory"/> that is responsible for
 /// creating a <see cref="TypeBuilder"/> instance.</param>
 /// <param name="serviceNameResolver">The <see cref="IServiceNameResolver"/> that is
 /// responsible for resolving the service name from a given factory method.</param>
 public AutoFactoryBuilder(ITypeBuilderFactory typeBuilderFactory, IServiceNameResolver serviceNameResolver)
 {
     this.serviceNameResolver = serviceNameResolver;
     this.typeBuilderFactory  = typeBuilderFactory;
 }