Example #1
0
        private string MakeResourceList(NccResource.ResourceType type, NccResource.IncludePosition position)
        {
            var content      = "";
            var resourceList = ThemeHelper.GetAllResources(type, position);

            foreach (var item in resourceList)
            {
                var version = "";
                if (string.IsNullOrEmpty(item.Version) == false)
                {
                    version = $"?{item.Version}";
                }
                if (type == NccResource.ResourceType.JsFile)
                {
                    content += $"<script type=\"text/javascript\" src=\"{item.FilePath}{version}\"></script>" + Environment.NewLine;
                }
                else if (type == NccResource.ResourceType.CssFile)
                {
                    content += $"<link rel=\"stylesheet\" type=\"text/css\" href=\"{item.FilePath}{version}\" />" + Environment.NewLine;
                }
            }

            return(content);
        }