/// <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);
        }
        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));

            }
        }
 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));
     }
 }
 /// <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;
 }