皮肤管理示例:
1 public interface IThemeProxy 2 { 3 List<Theme> Load(); 4 5 List<TemplateInfo> Load(string dir); 6 7 string Load(string file); 8 9 Theme GetDefault(); 10 11 void SetDefault(Theme theme); 12 13 void Delete(Theme theme); 14 15 void Upload(Theme theme); 16 17 void Save(string file, string fileContext); 18 } 1 public class ThemeProxyCollection : Collection<IThemeProxy> 2 { 3 4 } 1 public class ThemeProxies 2 { 3 public static ThemeProxyCollection Proxies = new ThemeProxyCollection() { 4 new DefaultThemeProxy() 5 }; 6 } |
2.AppContext.cs,它扮演什么角色,它能做什么事情。
皮肤管理,
错误、跟踪信息处理,
存放、获取上下文临时变量,
当前访问用户(基本账户信息,权限信息),
等等
3.Global.cs(AppRuntime.cs),看到这个类,你能想到它能做什么,在系统架构中他该扮演什么作用。
系统参数信息。。。
config配置信息。。。
系统路径快速获取帮助函数。。。
4.系统配置,系统经常出现的Enum类型,怎么管能让你的系统感觉到整洁。
AllEnums.cs来维护全局enum的上下文。。。
AllSettings.cs来维护全局配置信息。。。
等等
1 /// <summary> 2 /// 全局enum对象成员信息管理类 3 /// </summary> 4 public class AllEnums 5 { 6 public AllEnums() 7 { 8 } 9 10 public static EnumInfoCollection CategoriesTypeMembers { get; set; } 11 12 /// <summary> 13 /// 初始化全局enum对象成员信息 14 /// </summary> 15 public static void Init() 16 { 17 CategoriesTypeMembers = EnumUtil.GetEnumItems(typeof(CategoriesType)); 18 19 } 20 } |