private static void CheckRefresh(SettingsCollectionBase settings, string settingSubType) { if (_autoRefresh && settings.IsExpired(_refreshInterval)) { ReloadSettings(settings, settingSubType); } }
private static void LoadSettings(SettingsCollectionBase settings, string settingSubType) { using (EnterpriseTestContext context = DbConnect.EnterpriseTestContext()) { foreach (SystemSetting setting in context.SystemSettings.Where(n => n.Type == "SystemSetting" && n.SubType == settingSubType)) { settings.AddValue(setting.Name, setting.Value); } } settings.LoadTime = DateTime.Now; }
private static void ReloadSettings(SettingsCollectionBase settings, string settingSubType) { try { LoadSettings(settings, settingSubType); } catch (Exception ex) { TraceFactory.Logger.Debug("Settings refresh attempt failed: " + ex.Message); } }