Ejemplo n.º 1
0
 /// <summary>
 /// Обновить конфигурацию
 /// </summary>
 public void ReloadConfiguration()
 {
     ConfigurationManager.Reload();
     configuration = ConfigurationManager.CurrentConfiguration;
     if (service != null)
         service.Settings = configuration.ServiceSettings;
 }
 public static void Reload()
 {
     var cfg = LoadOrDefault();
     if (IsValid(cfg))
         CurrentConfiguration = cfg;
     else
         CurrentConfiguration = CreateDefault();
 }
 private static bool IsValid(Configuration config)
 {
     if (config == null)
         return false;
     if (config.PostLimit < 1 || config.PostLimit > 100)
         return false;
     if (config.RefreshInterval < 10 || config.RefreshInterval > 1000)
         return false;
     return true;
 }