Exemple #1
0
        public static HtmlString ScriptLibrary(this WebViewPage page, ScriptLibrary library)
        {
            if (page.IsAjax)
            {
                return(new HtmlString(string.Empty));
            }

            GetContextScripts(page).AddLibrary(library);

            return(new HtmlString(string.Empty));
        }
Exemple #2
0
        public void AddLibrary(ScriptLibrary library)
        {
            if (Libraries == null)
            {
                Libraries = new HashSet <ScriptLibrary>();
            }

            if (LibraryOrder == null)
            {
                LibraryOrder = new List <ScriptLibrary>();
            }

            AddLibraryInternal(library);
        }
Exemple #3
0
        private void AddLibraryInternal(ScriptLibrary library)
        {
            if (Libraries.Contains(library))
            {
                return;
            }

            if (library.Dependencies != null)
            {
                foreach (var dependentLibrary in library.Dependencies)
                {
                    AddLibraryInternal(dependentLibrary);
                }
            }

            Libraries.Add(library);
            LibraryOrder.Add(library);
        }