/// <summary> /// Create the view engine. /// </summary> public static void Init() { // Create new precompiled view engine var engine = new PrecompiledMvcEngine(typeof(ManagerModule).Assembly) { UsePhysicalViewsIfNewer = true }; engine.PartialViewLocationFormats = engine.PartialViewLocationFormats.Union(ExtensionsFolder).ToArray(); var standard = new RazorViewEngine(); standard.PartialViewLocationFormats = standard.PartialViewLocationFormats.Union(ExtensionsFolder).ToArray(); ViewEngines.Engines.Insert(0, standard); ViewEngines.Engines.Insert(1, engine); VirtualPathFactoryManager.RegisterVirtualPathFactory(engine); // Register the manager area var manager = new ManagerRegistration(); var context = new AreaRegistrationContext(manager.AreaName, RouteTable.Routes); manager.RegisterArea(context); // Register custom model binders RegisterBinders(); // Register json deserialization for post data ValueProviderFactories.Factories.Add(new JsonValueProviderFactory()); // Register application part ApplicationPart.Register(new ApplicationPart(typeof(ManagerModule).Assembly, "~/")); }
internal static void RegisterAdminModule() { // Add a admin module as an application module (precompiled) ApplicationPart.Register( new ApplicationPart(typeof(SiteAdmin).Assembly, AdminVirtualPath) ); }
public static void Start() { SiteAdmin.Register("~/Rabbit/", "Rabbit Framework Admin", "Administrative Tools to manage modules, to generate code and to run unit tests."); var appPart = new ApplicationPart(typeof(PreApplicationStartCode).Assembly, SiteAdmin.GetVirtualPath("~/Rabbit/")); ApplicationPart.Register(appPart); SiteEngine.Start(); }
public static void Start() { if (_startCalled) { return; } _startCalled = true; var type = typeof(PreApplicationStartCode); // This is to make the precompiled web site work ApplicationPart.Register(new ApplicationPart(type.Assembly, @"~/sample")); // This is to make the precompiled helper work without an import. WebPageRazorHost.AddGlobalImport(type.Namespace); }