Ext.Net.BaseScriptBuilder.RegisterResources C# (CSharp) Méthode

RegisterResources() protected méthode

protected RegisterResources ( string script ) : string
script string
Résultat string
        protected virtual string RegisterResources(string script)
        {
            if (HttpContext.Current.CurrentHandler is Page && !(HttpContext.Current.CurrentHandler is ISelfRenderingPage) && !this.ForceResources)
            {
                return script;
            }

            if (this.scriptsResources.Count > 0 || this.stylesResources.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("Ext.net.ResourceMgr.load([");
                bool comma = false;

                foreach (KeyValuePair<string, string> item in this.scriptsResources)
                {
                    if (comma)
                    {
                        sb.Append(",");
                    }

                    comma = true;
                    sb.Append("{url:").Append(JSON.Serialize(item.Value)).Append("}");
                }

                foreach (KeyValuePair<string, string> item in this.stylesResources)
                {
                    if (comma)
                    {
                        sb.Append(",");
                    }

                    comma = true;
                    sb.Append("{mode:\"css\",url:").Append(JSON.Serialize(item.Value)).Append("}");
                }

                sb.Append("], function(){");
                sb.Append(script);
                sb.Append("});");

                return sb.ToString();
            }

            return script;
        }