Пример #1
0
        /// <summary>
        /// Copy the jQuery components.
        /// </summary>
        private void CopyScriptFilesFromComponents()
        {
            foreach (IScriptableComponent component in scriptableComponents)
            {
                string assetKey  = string.IsNullOrEmpty(component.AssetKey) ? "default" : component.AssetKey;
                string filesPath = component.ScriptFilesPath;

                if (assetKey.IsCaseInsensitiveEqual("default") && WebAssetDefaultSettings.ScriptFilesPath.IsCaseInsensitiveEqual(filesPath))
                {
                    if (!DefaultGroup.DefaultPath.IsCaseInsensitiveEqual(WebAssetDefaultSettings.ScriptFilesPath))
                    {
                        filesPath = DefaultGroup.DefaultPath;
                    }
                }

                component.ScriptFileNames.Each(source => Scripts.Add(assetKey, MvcManager.CombinePath(filesPath, source)));
            }
        }
Пример #2
0
 /// <summary>
 /// Copy the jQuery files.
 /// </summary>
 private void CopyFrameworkScriptFiles()
 {
     if (!ExcludeFrameworkScripts)
     {
         FrameworkScriptFileNames.Reverse().Each(source =>
                                                 DefaultGroup.Items.Insert(0, new WebAssetItem(MvcManager.CombinePath(DefaultGroup.DefaultPath, source))));
     }
 }
Пример #3
0
        /// <summary>
        /// Create the item in the web asset item collection.
        /// </summary>
        /// <param name="source">The name of the item to add.</param>
        /// <returns>The created web asset item.</returns>
        private WebAssetItem CreateItem(string source)
        {
            // If the instance object is null.
            if (source == null)
            {
                throw new System.ArgumentNullException("source");
            }

            string itemSource = source.StartsWith("~/",
                                                  StringComparison.OrdinalIgnoreCase) ? source : MvcManager.CombinePath(_assetItemGroup.DefaultPath, source);

            // Return the script web item
            return(new WebAssetItem(itemSource));
        }
Пример #4
0
        /// <summary>
        /// Create the web asset item
        /// </summary>
        /// <param name="source">The name of the source.</param>
        /// <returns>The new web asset item.</returns>
        private WebAssetItem CreateItem(string source)
        {
            string itemSource = source.StartsWith("~/", StringComparison.OrdinalIgnoreCase) ? source : MvcManager.CombinePath(DefaultPath, source);

            return(new WebAssetItem(itemSource));
        }