예제 #1
0
 public ConfigHelper(string path)
 {
     Logger.InfoFormat("Inizializzazione ConfigHelper da {0}", path);
     _cachedValues = new Map();
     var cfg = new Xml(path);
     using (cfg.Buffer()) {
         foreach (string section in cfg.GetSectionNames()) {
             var map = new Map();
             _cachedValues[section] = map;
             foreach (string key in cfg.GetEntryNames(section))
                 map[key] = cfg.GetValue(section, key);
         }
         _cachedValues["ModelloDatabase"] = cfg.GetValue("Settings", "ModelloDatabase", ServerFacade.SqlServer);
         _cachedValues["StringaDiConnessione"] = Crypto.FastDecrypt(cfg.GetValue("Settings", "StringaDiConnessione", Crypto.FastEncrypt("")));
         _cachedValues["MainTimer"] = cfg.GetValue("Settings", "MainTimer", 60);
     }
 }