Exemplo n.º 1
0
 public void TestInitialize()
 {
     customizer = new Customizer();
     Customizer.SetLocator(new SingleCustomizerLocator(customizer));
     Customizer.SetResolver(new DefaultTypeResolver());
     Initialize();
 }
Exemplo n.º 2
0
 protected override void Initialize()
 {
     Customizer.SetResolver(new TypeResolver(Container));
     Context.Strategies.AddNew <CreationStrategy>(UnityBuildStage.PreCreation);
     Context.Strategies.AddNew <InitializationStrategy>(UnityBuildStage.Initialization);
     Context.Registering += Context_Registering;
 }
Exemplo n.º 3
0
 public static IContainer Setup(IContainer container)
 {
     Customizer.SetResolver(new TypeResolver(container));
     foreach (var item in container.ComponentRegistry.Registrations.OfType <ComponentRegistration>())
     {
         if (!(item.Activator is InstanceActivator) && item.Activator.LimitType.IsClass && !item.Activator.LimitType.IsAbstract)
         {
             item.Activator = new InstanceActivator(item.Activator);
         }
     }
     return(container);
 }