public static void addNewServerConfig(Hashtable Params) { ZabbixServerConfigCollection zabbixServersList = getZabbixServersList(); if (zabbixServersList == null) { zabbixServersList = new ZabbixServerConfigCollection(); } zabbixServersList.Add(new ZabbixServerConfig(Params)); updateServerConfigs(zabbixServersList); }
public static void updateServerConfigs(ZabbixServerConfigCollection zabbixServersList) { Configuration appConfig = _getAppConfig(); ZabbixServerConfigSection newSection = new ZabbixServerConfigSection(); newSection.ServersList = zabbixServersList; appConfig.Sections.Remove("ZabbixServers"); appConfig.Sections.Add("ZabbixServers", newSection); appConfig.Save(); }