public JavaScriptResult LegacyTreeJs() { Func <string> getResult = () => { var javascript = new StringBuilder(); javascript.AppendLine(LegacyTreeJavascript.GetLegacyTreeJavascript()); javascript.AppendLine(LegacyTreeJavascript.GetLegacyIActionJavascript()); //add all of the menu blocks foreach (var file in GetLegacyActionJs(LegacyJsActionType.JsBlock)) { javascript.AppendLine(file); } return(javascript.ToString()); }; //cache the result if debugging is disabled var result = HttpContext.IsDebuggingEnabled ? getResult() : ApplicationContext.ApplicationCache.RuntimeCache.GetCacheItem <string>( typeof(BackOfficeController) + "LegacyTreeJs", () => getResult(), new TimeSpan(0, 10, 0)); return(JavaScript(result)); }
/// <summary> /// Returns a string with javascript proxy methods for IActions that are using old javascript /// </summary> /// <returns></returns> public string GetLegacyIActionJavascript() { return(LegacyTreeJavascript.GetLegacyIActionJavascript()); }