예제 #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);
        }
예제 #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));

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