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)); }
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; }
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); }