Exemplo n.º 1
0
        public static IIoc NewIocWith(IIocRegister iocRegister)
        {
            var result = new WindsorIoc();

            result.BuildContainer();

            iocRegister.RegisterMappings(result);

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Registers a type with it's implementation if it's not registered before.
        /// </summary>
        /// <param name="iocRegister">Registrar</param>
        /// <param name="type">Type of the class</param>
        /// <param name="impl">The type that implements <paramref name="type" /></param>
        /// <param name="lifeStyle">Lifestyle of the objects of this type</param>
        /// <returns>True, if registered for given implementation.</returns>
        public static bool RegisterIfNot(this IIocRegister iocRegister, Type type, Type impl,
                                         DependencyLifeStyle lifeStyle = DependencyLifeStyle.Singleton)
        {
            if (iocRegister.IsRegistered(type))
            {
                return(false);
            }

            iocRegister.Register(type, impl, lifeStyle);
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Registers a type as self registration if it's not registered before.
        /// </summary>
        /// <typeparam name="T">Type of the class</typeparam>
        /// <param name="iocRegister">Register</param>
        /// <param name="lifeStyle">Lifestyle of the objects of this type</param>
        /// <returns>True, if registered for given implementation.</returns>
        public static bool RegisterIfNot <T>(this IIocRegister iocRegister,
                                             DependencyLifeStyle lifeStyle = DependencyLifeStyle.Singleton)
            where T : class
        {
            if (iocRegister.IsRegistered <T>())
            {
                return(false);
            }

            iocRegister.Register <T>(lifeStyle);
            return(true);
        }
Exemplo n.º 4
0
        public void Add(IIocRegister register)
        {

        }
Exemplo n.º 5
0
 internal static void Add(IIocRegister register)
 {
     _iocRegisters.Add(register);
 }
Exemplo n.º 6
0
 public static void Add(IIocRegister register)
 {
     _iocRegisters.Add(register);
 }
Exemplo n.º 7
0
 public void Add(IIocRegister register)
 {
 }
Exemplo n.º 8
0
 internal static void Add(IIocRegister register)
 {
     _iocRegisters.Add(register);
 }
Exemplo n.º 9
0
 public static void Add(IIocRegister register)
 {
     _iocRegisters.Add(register);
 }