Inheritance: DynamicScript, INamedDynamicScript
        public static string GetLocalTextInclude(this HtmlHelper page, string package)
        {
            string languageId = CultureInfo.CurrentUICulture.Name.TrimToNull() ?? "invariant";
            var context = Dependency.TryResolve<ILocalTextContext>();
            var isPending = context != null && context.IsApprovalMode;
            string scriptName = LocalTextScript.GetScriptName(package, languageId, isPending);
            DynamicScriptManager.IfNotRegistered(scriptName, () =>
            {
                var script = new LocalTextScript(package, (string)languageId, isPending);
                DynamicScriptManager.Register(script);
            });

            return DynamicScriptManager.GetScriptInclude(scriptName);
        }
        public static string GetLocalTextInclude(this HtmlHelper page, string package)
        {
            int    languageId = (int)LocalText.ContextLanguageID;
            bool   isPending  = LocalText.ContextPending;
            string scriptName = LocalTextScript.GetScriptName(package, languageId, isPending);

            DynamicScriptManager.IfNotRegistered(scriptName, () =>
            {
                var script = new LocalTextScript(package, languageId, isPending);
                DynamicScriptManager.Register(script);
            });

            return(DynamicScriptManager.GetScriptInclude(scriptName));
        }
Beispiel #3
0
        public static string GetLocalTextInclude(this HtmlHelper page, string package)
        {
            string languageId = CultureInfo.CurrentUICulture.Name.TrimToNull() ?? "invariant";
            var    context    = Dependency.TryResolve <ILocalTextContext>();
            var    isPending  = context != null && context.IsApprovalMode;
            string scriptName = LocalTextScript.GetScriptName(package, languageId, isPending);

            DynamicScriptManager.IfNotRegistered(scriptName, () =>
            {
                var script = new LocalTextScript(package, (string)languageId, isPending);
                DynamicScriptManager.Register(script);
            });

            return(DynamicScriptManager.GetScriptInclude(scriptName));
        }