/// <summary>
        ///  Wires everything up
        /// </summary>
        /// <returns></returns>
        public virtual IUmbracoApplicationContext Boot()
        {
            LogHelper.TraceIfEnabled <BootManager>("Booting");
            var container = _containerDelegate();

            container.AddDependencyDemandBuilder(_umbracoWireup);

            var built = container.Build();
            //var resolver = (IDependencyResolver)Activator.CreateInstance(_dependencyResolverType, new[] { built });
            var mvcResolver = _mvcResolverFactory.Invoke(built);

            DependencyResolver.SetResolver(mvcResolver);

            _taskManager = built.Resolve <ApplicationTaskManager>();

            //launch pre-app startup tasks
            _taskManager.ExecuteInContext(TaskTriggers.PreAppStartupComplete, new TaskExecutionContext(this, null));

            // Initialise the Umbraco system (v2)
            // If this is a Cms app:
            LogHelper.TraceIfEnabled <BootManager>("Booting CmsBootstrapper");
            built.Resolve <CmsBootstrapper>().Boot(RouteTable.Routes);

            // If this is a front-end app:
            LogHelper.TraceIfEnabled <BootManager>("Booting RenderBootstrapper");
            built.Resolve <RenderBootstrapper>().Boot(RouteTable.Routes);

            //launch post app startup tasks
            _taskManager.ExecuteInContext(TaskTriggers.PostAppStartup, new TaskExecutionContext(this, null));

            return(built.Resolve <IUmbracoApplicationContext>());
        }
Beispiel #2
0
        /// <summary>
        ///  Wires everything up
        /// </summary>
        /// <returns></returns>
        public virtual IRebelApplicationContext Boot()
        {
            Mandate.That <NullReferenceException>(_mvcDefaultRouteRegistration != null);
            Mandate.That <NullReferenceException>(_mvcAreaRegistration != null);
            Mandate.That <NullReferenceException>(_mvcCustomRouteRegistration != null);
            Mandate.That <NullReferenceException>(_mvcGlobalFilterRegistration != null);

            LogHelper.TraceIfEnabled <BootManager>("Booting");
            var container = _containerDelegate();

            container.AddDependencyDemandBuilder(_rebelWireup);

            var built = container.Build();
            //var resolver = (IDependencyResolver)Activator.CreateInstance(_dependencyResolverType, new[] { built });
            var mvcResolver = _mvcResolverFactory.Invoke(built);

            DependencyResolver.SetResolver(mvcResolver);

            _taskManager = built.Resolve <ApplicationTaskManager>();

            //launch pre-app startup tasks
            _taskManager.ExecuteInContext(TaskTriggers.PreAppStartupComplete, new TaskExecutionContext(this, null));

            // Initialise the Rebel system (v2)
            // If this is a Cms app:
            LogHelper.TraceIfEnabled <BootManager>("Booting CmsBootstrapper");
            built.Resolve <CmsBootstrapper>().Boot(RouteTable.Routes);

            //register all standard MVC components after the CmsBootstrapper (which registers our custom areas)
            LogHelper.TraceIfEnabled <BootManager>("Registering MVC areas");
            _mvcAreaRegistration();

            LogHelper.TraceIfEnabled <BootManager>("Registering custom MVC routes");
            _mvcCustomRouteRegistration();

            // If this is a front-end app:
            LogHelper.TraceIfEnabled <BootManager>("Booting RenderBootstrapper");
            built.Resolve <RenderBootstrapper>().Boot(RouteTable.Routes);

            LogHelper.TraceIfEnabled <BootManager>("Registering MVC global filters");
            _mvcGlobalFilterRegistration();

            LogHelper.TraceIfEnabled <BootManager>("Registering MVC default routes");
            _mvcDefaultRouteRegistration();

            //launch post app startup tasks
            _taskManager.ExecuteInContext(TaskTriggers.PostAppStartup, new TaskExecutionContext(this, null));

            return(built.Resolve <IRebelApplicationContext>());
        }
Beispiel #3
0
        /// <summary>
        ///  Wires everything up
        /// </summary>
        /// <returns></returns>
        public virtual IRebelApplicationContext Boot()
        {
            Mandate.That<NullReferenceException>(_mvcDefaultRouteRegistration != null);
            Mandate.That<NullReferenceException>(_mvcAreaRegistration != null);
            Mandate.That<NullReferenceException>(_mvcCustomRouteRegistration != null);
            Mandate.That<NullReferenceException>(_mvcGlobalFilterRegistration != null);

            LogHelper.TraceIfEnabled<BootManager>("Booting");
            var container = _containerDelegate();
            container.AddDependencyDemandBuilder(_rebelWireup);

            var built = container.Build();
            //var resolver = (IDependencyResolver)Activator.CreateInstance(_dependencyResolverType, new[] { built });
            var mvcResolver = _mvcResolverFactory.Invoke(built);
            DependencyResolver.SetResolver(mvcResolver);

            _taskManager = built.Resolve<ApplicationTaskManager>();

            //launch pre-app startup tasks
            _taskManager.ExecuteInContext(TaskTriggers.PreAppStartupComplete, new TaskExecutionContext(this, null));

            // Initialise the Rebel system (v2)
            // If this is a Cms app:
            LogHelper.TraceIfEnabled<BootManager>("Booting CmsBootstrapper");
            built.Resolve<CmsBootstrapper>().Boot(RouteTable.Routes);

            //register all standard MVC components after the CmsBootstrapper (which registers our custom areas)
            LogHelper.TraceIfEnabled<BootManager>("Registering MVC areas");
            _mvcAreaRegistration();

            LogHelper.TraceIfEnabled<BootManager>("Registering custom MVC routes");
            _mvcCustomRouteRegistration();

            // If this is a front-end app:
            LogHelper.TraceIfEnabled<BootManager>("Booting RenderBootstrapper");
            built.Resolve<RenderBootstrapper>().Boot(RouteTable.Routes);

            LogHelper.TraceIfEnabled<BootManager>("Registering MVC global filters");
            _mvcGlobalFilterRegistration();

            LogHelper.TraceIfEnabled<BootManager>("Registering MVC default routes");
            _mvcDefaultRouteRegistration();

            //launch post app startup tasks
            _taskManager.ExecuteInContext(TaskTriggers.PostAppStartup, new TaskExecutionContext(this, null));

            return built.Resolve<IRebelApplicationContext>();
        }