Exemplo n.º 1
0
        public override IMutablePicoContainer MakeChildContainer()
        {
            ImplementationHidingPicoContainer pc = new ImplementationHidingPicoContainer(caf, this, lifecycleManager);

            DelegateContainer.AddChildContainer(pc);
            return(pc);
        }
		public void UsageOfADifferentComponentAdapterFactory()
		{
			// Jira bug 212
			IMutablePicoContainer parent = new DefaultPicoContainer();
			ImplementationHidingPicoContainer pico = new ImplementationHidingPicoContainer(new ConstructorInjectionComponentAdapterFactory(), parent);
			pico.RegisterComponentImplementation(typeof (IList), typeof (ArrayList));

			IList list1 = (IList) pico.GetComponentInstanceOfType(typeof (IList));

			IList list2 = (IList) pico.GetComponentInstanceOfType(typeof (IList));

			Assert.IsNotNull(list1);
			Assert.IsNotNull(list2);
			Assert.IsFalse(list1 == list2);
		}
        public void UsageOfADifferentComponentAdapterFactory()
        {
            // Jira bug 212
            IMutablePicoContainer             parent = new DefaultPicoContainer();
            ImplementationHidingPicoContainer pico   =
                new ImplementationHidingPicoContainer(new ConstructorInjectionComponentAdapterFactory(), parent);

            pico.RegisterComponentImplementation(typeof(IList), typeof(ArrayList));

            IList list1 = (IList)pico.GetComponentInstanceOfType(typeof(IList));

            IList list2 = (IList)pico.GetComponentInstanceOfType(typeof(IList));

            Assert.IsNotNull(list1);
            Assert.IsNotNull(list2);
            Assert.IsFalse(list1 == list2);
        }
 public override IMutablePicoContainer MakeChildContainer()
 {
     ImplementationHidingPicoContainer pc = new ImplementationHidingPicoContainer(caf, this, lifecycleManager);
     DelegateContainer.AddChildContainer(pc);
     return pc;
 }