controller-factory

JavaFX custom controller factory

大憨熊 提交于 2019-12-04 04:58:31
I have been experimenting with the FXMLLoader and using the setControllerFactory method using a custom Callback<P,R> implementation. The ORACLE documentation says the following: An implementation might return a null value to indicate that it does not or cannot create a controller of the given type; in this case, the default controller construction mechanism will be employed by the loader. The result I want to achieve is that I can use a dependency injection framework to create any controllers that require parameters but I will let the FXMLLoader load any controllers that do not require

ControllerFactory for specific portable area

≡放荡痞女 提交于 2019-12-03 15:26:14
My main ASP.NET MVC composite application uses a global Unity container to register types. The app sets the controller factory up to use this global container. I would like to refactor this such that each one of my portable areas leverages it's own child Unity container, so that different areas can implement interfaces in varying ways. It seems like I would need to have a different ControllerFactory per area. How would I accomplish that, given that the following sets the factory for all? ControllerBuilder.Current .SetControllerFactory(/* controller factory with global unity container */); You

Best place to set CurrentCulture for multilingual ASP.NET MVC web applications

时光总嘲笑我的痴心妄想 提交于 2019-11-26 22:03:55
For multilingual ASP.NET MVC 3 web application, I am determining the Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture on the controller factory as follows: public class MyControllerFactory : DefaultControllerFactory { protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType) { //Get the {language} parameter in the RouteData string UILanguage; if (requestContext.RouteData.Values["language"] == null) UILanguage = "tr"; else UILanguage = requestContext.RouteData.Values["language"].ToString(); //Get the