Пример #1
0
 /// <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));
 }
Пример #2
0
        static public void QuestionListClear()
        {
            string key = QUESTIONLIST;

            if (CHCache.Contains(key))
            {
                CHCache.Remove(key);
            }
        }
Пример #3
0
        static public void GroupClear(long groupid)
        {
            string key = GROUP;

            if (CHCache.Contains(key))
            {
                CHCache.Remove(key);
            }
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
 public static void Clear(string fn)
 {
     CHCache.Remove(fn);
 }