/// <summary> /// 从配置文件反序列化 /// </summary> /// <typeparam name="T">反序列化的目标类型</typeparam> /// <param name="fn">键</param> /// <returns></returns> public static T Load <T>(string fn) where T : class { if (!CHCache.Contains(fn)) { CHCache.Add(fn, _Load <T>(fn)); } return(CHCache.Get <T>(fn)); }
static public void QuestionListClear() { string key = QUESTIONLIST; if (CHCache.Contains(key)) { CHCache.Remove(key); } }
static public void GroupClear(long groupid) { string key = GROUP; if (CHCache.Contains(key)) { CHCache.Remove(key); } }
static DataTable AllQuestion(DataBaseExecutor db) { string key = QUESTIONLIST; DataTable dt = null; if (CHCache.Contains(key)) { dt = CHCache.Get <DataTable>(key); } else { dt = db.GetTable(@"SELECT * FROM [Question]"); // where istrue=1 CHCache.Add(key, dt); } return(dt); }
static DataTable GroupTable(DataBaseExecutor db) { string key = GROUP; DataTable dt = null; if (CHCache.Contains(key)) { dt = CHCache.Get <DataTable>(key); } else { dt = db.GetTable(@"SELECT * FROM [Group]"); CHCache.Add(key, dt); } return(dt); }
public static void Clear(string fn) { CHCache.Remove(fn); }