예제 #1
0
 private static void RegisterControllers(
     this IWindsorContainer container, params Type[] controllerTypes)
 {
     foreach (Type type in controllerTypes) {
         if (ControllerExtensions.IsController(type)) {
             container.AddComponentLifeStyle(type.FullName.ToLower(),
                 type, LifestyleType.Transient);
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Registers all controllers in the given assembly with the Engine, so that they may be resolved correctly.
 /// </summary>
 /// <param name="engine"></param>
 /// <param name="assembly"></param>
 public static void RegisterControllers(this IEngine engine, Assembly assembly)
 {
     foreach (Type type in assembly.GetExportedTypes())
         if (IsController(type))
             engine.AddComponentLifeStyle(type.FullName.ToLower(), type, ComponentLifeStyle.Transient);
 }