Esempio n. 1
0
        public override void Load()
        {
            ConnectionString = ConfigurationManager.ConnectionStrings["SqlServ"]?.ConnectionString;
            string ServersUrlsString = ConfigurationManager.AppSettings["ServersUrls"];

            string[] clientsUrlsStr = ServersUrlsString?.Split(';').Select(s => s.Trim()).ToArray();

            if (clientsUrlsStr != null)
            {
                foreach (var client in clientsUrlsStr)
                {
                    try {
                        Uri clientUri = new Uri(client);
                        ServersUrls.Add(clientUri);
                    } catch (UriFormatException ex) {
                        throw new ArgumentException($"Incorrect format of URL has been  added to settings file! ({ex.Message})");
                    }
                }
            }
        }
 public void AddServer(string serverId, string url)
 {
     ServerServices.Add(serverId, PuppetMaster.urlToNodeService(url));
     ServersUrls.Add(serverId, url);
 }