Inheritance: System.Web.Mvc.AreaRegistration
Esempio n. 1
0
 public CmsBootstrapper(RebelSettings settings,
     RebelAreaRegistration areaRegistration,
     InstallAreaRegistration installRegistration,
     IEnumerable<PackageAreaRegistration> componentAreas)
 {
     _areaRegistration = areaRegistration;
     _installRegistration = installRegistration;
     _componentAreas = componentAreas;
     _settings = settings;
     _attributeTypeRegistry = new DependencyResolverAttributeTypeRegistry();
 }
Esempio n. 2
0
 public CmsBootstrapper(RebelSettings settings,
     RebelAreaRegistration areaRegistration,
     InstallAreaRegistration installRegistration,
     IEnumerable<PackageAreaRegistration> componentAreas,
     IAttributeTypeRegistry attributeTypeRegistry)
 {
     _areaRegistration = areaRegistration;
     _installRegistration = installRegistration;
     _componentAreas = componentAreas;
     _attributeTypeRegistry = attributeTypeRegistry;
     _settings = settings;
 }
        public void InitTest()
        {

            Init();

            RenderModelFactory = FakeRenderModelFactory.CreateWithApp();
            var frontEndRouteHandler = new RenderRouteHandler(new TestControllerFactory(), RebelApplicationContext, RenderModelFactory);

            //register areas/routes...            

            RouteTable.Routes.Clear();

            var packageFolder = new DirectoryInfo(Path.Combine(Common.CurrentAssemblyDirectory, "App_Plugins", PluginManager.PackagesFolderName, "TestPackage"));

            Components = new ComponentRegistrations(new List<Lazy<MenuItem, MenuItemMetadata>>(),
                                                    PluginHelper.GetEditorMetadata(packageFolder),
                                                    PluginHelper.GetTreeMetadata(packageFolder),
                                                    PluginHelper.GetSurfaceMetadata(packageFolder),
                                                    new List<Lazy<AbstractTask, TaskMetadata>>(),
                                                    new List<Lazy<PropertyEditor, PropertyEditorMetadata>>(),
                                                    new List<Lazy<AbstractParameterEditor, ParameterEditorMetadata>>(),
                                                    new List<Lazy<DashboardMatchRule, DashboardRuleMetadata>>(),
                                                    new List<Lazy<DashboardFilter, DashboardRuleMetadata>>(),
                                                    new List<Lazy<Permission, PermissionMetadata>>(),
                                                    new List<Lazy<AbstractMacroEngine, MacroEngineMetadata>>());

            var componentRegistration = new PackageAreaRegistration(packageFolder, RebelApplicationContext, Components);
            var areaRegistration = new RebelAreaRegistration(RebelApplicationContext, Components);
            var installRegistration = new InstallAreaRegistration(RebelApplicationContext.Settings);

            var cmsBootstrapper = new CmsBootstrapper(RebelApplicationContext.Settings, areaRegistration, installRegistration, new[] { componentRegistration }, new DefaultAttributeTypeRegistry());
            var renderBootstrapper = new RenderBootstrapper(RebelApplicationContext, frontEndRouteHandler, RenderModelFactory);

            //bootstrappers setup the routes
            cmsBootstrapper.Boot(RouteTable.Routes);
            renderBootstrapper.Boot(RouteTable.Routes);

            RebelWebApplication.RegisterDefaultRoutes(RouteTable.Routes);
        }