Пример #1
0
        public static ICachedManager GetCachedManager(string section)
        {
            CacheDbSection cds = (CacheDbSection)System.Configuration.ConfigurationManager.GetSection(section);

            if (cds == null)
            {
                throw new CacheDBException(section + " section not found!");
            }
            return(GetCachedManager(cds));
        }
Пример #2
0
 private static ICachedManager GetCachedManager(CacheDbSection section)
 {
     implement.CachedManager cm = new implement.CachedManager();
     DbManagerConfig dbconfig = section.DbManager;
     cm.DBManager = CreateDBManager(dbconfig);
     foreach (LevelCachedConfig config in section.Levels)
     {
         cm.AddLevel(config.Name, config.Maximum, config.UpgradeValue);
     }
     foreach (PolicyConfig policy in section.Policies)
     {
         CreatePolicy(policy, cm);
     }
     cm.DBManager.Open();
     return cm;
 }
Пример #3
0
        private static ICachedManager GetCachedManager(CacheDbSection section)
        {
            implement.CachedManager cm       = new implement.CachedManager();
            DbManagerConfig         dbconfig = section.DbManager;

            cm.DBManager = CreateDBManager(dbconfig);
            foreach (LevelCachedConfig config in section.Levels)
            {
                cm.AddLevel(config.Name, config.Maximum, config.UpgradeValue);
            }
            foreach (PolicyConfig policy in section.Policies)
            {
                CreatePolicy(policy, cm);
            }
            cm.DBManager.Open();
            return(cm);
        }