Exemple #1
0
        protected internal static string GetResourceUrl(IBuildResult info, string path, bool isDebug)
        {
            if (info == null)
            {
                if ((path == null) || (path.IndexOf("://") < 0))
                {
                    return(path);
                }

                string alt;
                MergeResourceCodeProvider.SplitAlternates(path, out path, out alt);
                return(isDebug ? path : alt);
            }

            string cache;

            if (isDebug)
            {
                cache = '?' + DebugResourceHandlerFactory.DebugFlag;
            }
            else if (!String.IsNullOrEmpty(info.Hash))
            {
                cache = '?' + info.Hash;
            }
            else
            {
                cache = "";
            }

            int index = path.IndexOf('?');

            if (index >= 0)
            {
                path = path.Substring(0, index);
            }

            return(path + cache);
        }
Exemple #2
0
        /// <summary>
        /// Include optimized resources
        /// </summary>
        /// <param name="compactUrl"></param>
        /// <param name="debugUrl"></param>
        /// <returns></returns>
        public static string ResourceInclude(string debugUrl, string compactUrl)
        {
            string url = MergeResourceCodeProvider.JoinAlternates(debugUrl, compactUrl);

            return(ResourceInclude(url));
        }