using System; using System.Collections.Generic; using System.Text; namespace CB.Config { /// /// 资源配置文件 By:JNswins /// public class ResourcesConfigInfo { /// /// 资源文件路劲 /// public string ResourcesPath { get; set; } /// /// 资源文件 /// public IList FileList { get; set; } } /// /// 资源文件 /// public class ResourcesFile { /// /// 文件名称 /// public string FileName { get; set; } /// /// 文件地址 /// public string FileUrl { get; set; } /// /// 版本 /// public int Version { get; set; } /// /// 是否本地资源文件 /// public bool IsLocal { get; set; } /// /// 资源文件类型 /// public ResourcesFileType FileType { get; set; } /// /// 返回文件地址 /// /// 资源文件配置路径 /// public string GetFileUrl(string path) { if (!IsLocal) return FileUrl; return string.Format("{0}{1}/{2}?v={3}", path, this.FileType.ToString().ToLower(), this.FileName.ToLower(), this.Version); } /// /// 返回HTML代码 /// /// /// public string GetFileHtml(string path) { switch (this.FileType) { case ResourcesFileType.CSS: return string.Format("", GetFileUrl(path)); case ResourcesFileType.JS: return string.Format("", GetFileUrl(path)); } return ""; } } /// /// 资源文件类型 /// public enum ResourcesFileType { CSS = 1, JS = 2, IMG = 3 } }