protected override Theme CreateInstance(Ninject.Activation.IContext context) { var themeServices = context.Kernel.Get <ThemeServices>(); RouteData routeData = RouteTable.Routes.GetRouteData(new HttpContextWrapper(HttpContext.Current)); Theme theme; if (routeData.GetAreaName() == "Admin") { theme = themeServices.GetAdminTheme(); } else { theme = themeServices.GetDefaultTheme(); } return(theme); }
//protected override OffLineLoggingComponent CreateInstance(IContext context) //{ // return new OffLineLoggingComponent(); //} protected override OffLineLoggingComponent CreateInstance(Ninject.Activation.IContext context) { return(new OffLineLoggingComponent()); }
protected override IDomComponent CreateInstance(Ninject.Activation.IContext context) { // Complex logic to figure out what gets created goes here return(new OffLineLoggingComponent()); }
protected override OffLineLoggingComponent CreateInstance(Ninject.Activation.IContext context) { //Normally there would be some really complex logic //here controling how this gets created return(new OffLineLoggingComponent()); }