Ejemplo n.º 1
0
        /// <summary>
        /// Converts ObjecttDef to the array of IRegistrations and registers them all within container
        /// </summary>
        public static IWindsorContainer Register(this IWindsorContainer windsorContainer, Type serviceType, ObjectDef def)
        {
            var v = new WindsorDependencyVisitor(serviceType, def, false);

            windsorContainer.Register(v.Registrations());
            return(windsorContainer);
        }
Ejemplo n.º 2
0
        void IDependencyVisitor.Configured(ConfiguredDependency dependency)
        {
            if (dependency.Definition.Value != null) {
                _registration.DependsOn(Dependency.OnValue(dependency.DependencyType, dependency.Definition.Value));
            }
            else {
                var v = new WindsorDependencyVisitor(dependency.DependencyType, dependency.Definition,true);
                _components.AddRange(v.Registrations());
                _registration.DependsOn(Dependency.OnComponent(dependency.DependencyType, dependency.Definition.Name));

            }
        }
Ejemplo n.º 3
0
 void IDependencyVisitor.Configured(ConfiguredDependency dependency)
 {
     if (dependency.Definition.Value != null)
     {
         _registration.DependsOn(Dependency.OnValue(dependency.DependencyType, dependency.Definition.Value));
     }
     else
     {
         var v = new WindsorDependencyVisitor(dependency.DependencyType, dependency.Definition, true);
         _components.AddRange(v.Registrations());
         _registration.DependsOn(Dependency.OnComponent(dependency.DependencyType, dependency.Definition.Name));
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Converts ObjecttDef to the array of IRegistrations and registers them all within container
 /// </summary>
 public static IWindsorContainer Register(this IWindsorContainer windsorContainer, Type serviceType, ObjectDef def)
 {
     var v = new WindsorDependencyVisitor(serviceType, def, false);
     windsorContainer.Register(v.Registrations());
     return windsorContainer;
 }