Exemplo n.º 1
0
 private static void RegisterComplexObject(ITargetContainer targets)
 {
     targets.RegisterSingleton <FirstService, IFirstService>();
     targets.RegisterSingleton <SecondService, ISecondService>();
     targets.RegisterSingleton <ThirdService, IThirdService>();
     targets.RegisterType <SubObjectOne, ISubObjectOne>();
     targets.RegisterType <SubObjectTwo, ISubObjectTwo>();
     targets.RegisterType <SubObjectThree, ISubObjectThree>();
     targets.RegisterType <Complex1, IComplex1>();
     targets.RegisterType <Complex2, IComplex2>();
     targets.RegisterType <Complex3, IComplex3>();
 }
Exemplo n.º 2
0
 private static void RegisterStandard(ITargetContainer targets)
 {
     // two options for singletons in Rezolver - a singleton target wrapping
     // another, and a straight constant object.  I think for the purposes of the
     // test we should be wrapping a constructor target.
     targets.RegisterSingleton <Singleton1, ISingleton1>();
     targets.RegisterSingleton <Singleton2, ISingleton2>();
     targets.RegisterSingleton <Singleton3, ISingleton3>();
     targets.RegisterType <Transient1, ITransient1>();
     targets.RegisterType <Transient2, ITransient2>();
     targets.RegisterType <Transient3, ITransient3>();
     targets.RegisterType <Combined1, ICombined1>();
     targets.RegisterType <Combined2, ICombined2>();
     targets.RegisterType <Combined3, ICombined3>();
 }
Exemplo n.º 3
0
        private static void RegisterPropertyInjection(ITargetContainer targets)
        {
            // this method is temporary till I add auto property injection - thinking I might do it as
            // an extension target that can be added to any other target (except another target)
            targets.RegisterSingleton <ServiceA, IServiceA>();
            targets.RegisterSingleton <ServiceB, IServiceB>();
            targets.RegisterSingleton <ServiceC, IServiceC>();

            targets.RegisterType <SubObjectA, ISubObjectA>(MemberBindingBehaviour.BindProperties);
            targets.RegisterType <SubObjectB, ISubObjectB>(MemberBindingBehaviour.BindProperties);
            targets.RegisterType <SubObjectC, ISubObjectC>(MemberBindingBehaviour.BindProperties);

            targets.RegisterType <ComplexPropertyObject1, IComplexPropertyObject1>(MemberBindingBehaviour.BindProperties);
            targets.RegisterType <ComplexPropertyObject2, IComplexPropertyObject2>(MemberBindingBehaviour.BindProperties);
            targets.RegisterType <ComplexPropertyObject3, IComplexPropertyObject3>(MemberBindingBehaviour.BindProperties);
        }