/// ------------------------------------------------------------------------------------------------- /// <summary> /// Runs this object. /// </summary> /// <remarks> /// LM ANWAR, 6/2/2013. /// </remarks> /// ------------------------------------------------------------------------------------------------- public static void Run() { bool designerMode = IsInClientBuildManager(); if (!hasInited) { Container.ScanAll(); // Register our module to handle any Post Start methods. But outside of ASP.NET, just run them now if (HostingEnvironment.IsHosted) { LazyHttpModule <IocManagerModule> .Register(() => new IocManagerModule()); LazyHttpModule <FilterHttpModule> .Register(() => new FilterHttpModule()); RunPreStartMethods(designerMode); LazyHttpModule <StartMethodCallingModule> .Register(() => new StartMethodCallingModule(designerMode)); } else { RunPreStartMethods(designerMode); RunPostStartMethods(designerMode); Bootstrapper.Run(); } hasInited = true; } }
public void Render(string expression, bool inverted, dynamic properties, IEnumerable <ITemplatePart> parts, ITemplateContext context) { IWebContext webContext = Container.Get <IWebContext>(); if (!webContext.InPreviewMode()) { string action = properties.action ?? "index"; string controller = properties.controller; RouteValueDictionary routeValueDict = properties.data != null ? new RouteValueDictionary(properties.data) : new RouteValueDictionary(); if (!string.IsNullOrWhiteSpace(action) || !string.IsNullOrWhiteSpace(controller)) { UrlHelper url = new UrlHelper(webContext.RequestContext); string route = url.Action(action, controller, routeValueDict); context.Write(route); } } else { context.Write("#"); } }