private void Save() { EventLogs pc = new EventLogs(); pc.Logs = Logs.ToList(); if (_cfg.AppSettings.Settings.AllKeys.Contains(ConfigConstants.EventLogs) == true) { _cfg.AppSettings.Settings[ConfigConstants.EventLogs].Value = pc.GetSerialized(); } else { _cfg.AppSettings.Settings.Add(ConfigConstants.EventLogs, pc.GetSerialized()); } _cfg.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings"); }
private void Save() { EventLogs pc = new EventLogs(); pc.Logs = Logs.ToList(); if (_cfg.AppSettings.Settings.AllKeys.Contains(ConfigConstants.EventLogs) == true) _cfg.AppSettings.Settings[ConfigConstants.EventLogs].Value = pc.GetSerialized(); else _cfg.AppSettings.Settings.Add(ConfigConstants.EventLogs, pc.GetSerialized()); _cfg.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings"); }