コード例 #1
0
 ///<summary>
 /// Creates a new bytecode Provider instance using the specified object factory
 ///</summary>
 ///<param name="listableObjectFactory"></param>
 public BytecodeProvider(IListableObjectFactory listableObjectFactory)
 {
     this.listableObjectFactory = listableObjectFactory;
     this.objectsFactory = new ObjectsFactory(listableObjectFactory);
     this.collectionTypefactory = new DefaultCollectionTypeFactory();
     this.proxyFactoryFactory = new ProxyFactoryFactory();
 }
コード例 #2
0
 ///<summary>
 /// Creates a new bytecode Provider instance using the specified object factory
 ///</summary>
 ///<param name="listableObjectFactory"></param>
 public BytecodeProvider(IListableObjectFactory listableObjectFactory)
 {
     this.listableObjectFactory = listableObjectFactory;
     this.objectsFactory        = new ObjectsFactory(listableObjectFactory);
     this.collectionTypefactory = new DefaultCollectionTypeFactory();
     this.proxyFactoryFactory   = new ProxyFactoryFactory();
 }
コード例 #3
0
        public void CreateInstanceOfValueType()
        {
            IObjectsFactory of       = GetObjectsFactory();
            var             instance = of.CreateInstance(typeof(ValueType), true);

            Assert.That(instance, Is.Not.Null);
            Assert.That(instance, Is.InstanceOf <ValueType>());
        }
コード例 #4
0
        public void CreateInstanceWithNoPublicCtor()
        {
            IObjectsFactory of = GetObjectsFactory();

            Assert.Throws <ArgumentNullException>(() => of.CreateInstance(null, false));
            var instance = of.CreateInstance(typeof(WithOutPublicParameterLessCtor), true);

            Assert.That(instance, Is.Not.Null);
            Assert.That(instance, Is.InstanceOf <WithOutPublicParameterLessCtor>());
        }
コード例 #5
0
        public void CreateInstanceDefCtor()
        {
            IObjectsFactory of = GetObjectsFactory();

            Assert.Throws <ArgumentNullException>(() => of.CreateInstance(null));
            Assert.Throws <MissingMethodException>(() => of.CreateInstance(typeof(WithOutPublicParameterLessCtor)));
            var instance = of.CreateInstance(typeof(PublicParameterLessCtor));

            Assert.That(instance, Is.Not.Null);
            Assert.That(instance, Is.InstanceOf <PublicParameterLessCtor>());
        }
コード例 #6
0
        public void CreateInstanceWithArguments()
        {
            IObjectsFactory of = GetObjectsFactory();

            Assert.Throws <ArgumentNullException>(() => of.CreateInstance(null, new[] { 1 }));
            var value    = "a value";
            var instance = of.CreateInstance(typeof(WithOutPublicParameterLessCtor), new[] { value });

            Assert.That(instance, Is.Not.Null);
            Assert.That(instance, Is.InstanceOf <WithOutPublicParameterLessCtor>());
            Assert.That(((WithOutPublicParameterLessCtor)instance).Something, Is.EqualTo(value));
        }
コード例 #7
0
 public NinjectBytecodeProvider( IKernel Kernel )
 {
     kernel = Kernel;
      objectsFactory = new ObjectsFactory( Kernel );
      collectionTypeFactory = new DefaultCollectionTypeFactory();
 }
コード例 #8
0
 public DiByteCodeProvider(INhDependencyResolver dependencyResolver)
 {
     this.objectsFactory = new DiObjectsFactory(dependencyResolver);
 }
コード例 #9
0
ファイル: EnhancedBytecode.cs プロジェクト: Mrding/Ribbon
 public EnhancedBytecode(IWindsorContainer container)
 {
     this.container = container;
     objectsFactory = new ObjectsFactory(container);
 }
コード例 #10
0
 public StructureMapBackedBytecodeProvider(IContainer container)
 {
     this.container        = container;
     objectsFactory        = new StructureMapBackedObjectsFactory(this.container);
     collectionTypefactory = new DefaultCollectionTypeFactory();
 }
コード例 #11
0
 public BytecodeProvider(IServiceLocator serviceLocator)
 {
     _serviceLocator = serviceLocator;
       _objectsFactory = new ObjectsFactory();
       _collectionTypeFactory = new DefaultCollectionTypeFactory();
 }
コード例 #12
0
 public EnhancedBytecode(IListableObjectFactory listableObjectFactory)
 {
     this.listableObjectFactory = listableObjectFactory;
     objectsFactory             = new ObjectsFactory(listableObjectFactory);
     collectionTypefactory      = new DefaultCollectionTypeFactory();
 }
コード例 #13
0
 public EnhancedBytecode(IWindsorContainer container)
 {
     this.container = container;
     objectsFactory = new ObjectsFactory(container);
 }
コード例 #14
0
 public EnhancedBytecodeProvider(IWindsorContainer container)
 {
     this.container = container;
     _objectsFactory = new WindsorNHibernateObjectsFactory(container);
 }
コード例 #15
0
 public StructureMapBackedBytecodeProvider(IContainer container) {
     this.container = container;
     objectsFactory = new StructureMapBackedObjectsFactory(this.container);
     collectionTypefactory = new DefaultCollectionTypeFactory();
 }
コード例 #16
0
 public BytecodeProvider(IWindsorContainer container)
 {
     _container      = container;
     _objectsFactory = new ObjectsFactory(container);
 }