예제 #1
0
 private static void CheckRefresh(SettingsCollectionBase settings, string settingSubType)
 {
     if (_autoRefresh && settings.IsExpired(_refreshInterval))
     {
         ReloadSettings(settings, settingSubType);
     }
 }
예제 #2
0
 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;
 }
예제 #3
0
 private static void ReloadSettings(SettingsCollectionBase settings, string settingSubType)
 {
     try
     {
         LoadSettings(settings, settingSubType);
     }
     catch (Exception ex)
     {
         TraceFactory.Logger.Debug("Settings refresh attempt failed: " + ex.Message);
     }
 }