public Controller CreateController(UrlInfo urlInfo) { IWindsorContainer container = ContainerAccessorUtil.ObtainContainer(); ControllerTree tree = null; try { tree = (ControllerTree)container["rails.controllertree"]; } catch (ComponentNotFoundException) { throw new RailsException("ControllerTree not found. Check whether RailsFacility is properly configured/registered"); } String key = (String)tree.GetController(urlInfo.Area, urlInfo.Controller); if (key == null || key.Length == 0) { throw new ControllerNotFoundException(urlInfo); } if (container.Kernel.HasComponent(key)) { return((Controller)container[key]); } return(null); }
public override void Release(IFilter filter) { IWindsorContainer container = ContainerAccessorUtil.ObtainContainer(); container.Release(filter); base.Release(filter); }
public override IFilter Create(Type filterType) { IWindsorContainer container = ContainerAccessorUtil.ObtainContainer(); if (container.Kernel.HasComponent(filterType)) { return((IFilter)container[filterType]); } else { return(base.Create(filterType)); } }
public ViewComponent Create(String name) { IWindsorContainer container = ContainerAccessorUtil.ObtainContainer(); if (container.Kernel.HasComponent(name)) { try { return((ViewComponent)container[name]); } catch (InvalidCastException ex) { throw new RailsException("The component registered for the given key could not be casted into a ViewComponent. Key " + name, ex); } } else { throw new RailsException("No ViewComponent registered in the container for key " + name); } }
public void Release(Controller controller) { ContainerAccessorUtil.ObtainContainer().Release(controller); }