示例#1
0
        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);
        }
示例#2
0
 //protected override OffLineLoggingComponent CreateInstance(IContext context)
 //{
 //    return new OffLineLoggingComponent();
 //}
 protected override OffLineLoggingComponent CreateInstance(Ninject.Activation.IContext context)
 {
     return(new OffLineLoggingComponent());
 }
示例#3
0
 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());
 }