예제 #1
0
        /// <summary>
        /// 引用静态资源文件
        /// </summary>
        /// <param name="collector"></param>
        /// <returns></returns>
        public static string Include(Action <IResourceCollector> collector)
        {
            IResourceCollector resources = new ResourceCollector();

            collector(resources);
            return(resources.BuildHtmlTag());
            //return new HtmlString(resources.BuildHtmlTag());
        }
예제 #2
0
        /// <summary>
        /// 组装控件引用的所有资源项
        /// </summary>
        private ResourceCollector GenerateResources()
        {
            ResourceCollector collector = new ResourceCollector()
            {
                BaseFolder   = BaseFolder,
                Debug        = Debug,
                Group        = Group,
                ResourceType = resourceType
            };

            string[] pathList = Path.Split(new char[] { ';', '\n', ',', ';', '|' }, StringSplitOptions.RemoveEmptyEntries);
            string   path     = string.Empty;

            foreach (string url in pathList)
            {
                path = url.Trim();
                if (!string.IsNullOrEmpty(path))
                {
                    collector.Add(path);
                }
            }

            return(collector);
        }