/// <summary> /// Adds a new site to the configuration file /// </summary> /// <param name="siteName">The name of the site</param> private void AddSite(String siteName = "") { siteName = siteName == "" ? CommandUtils.Ask("Site Name?") : siteName; if (Program.Settings.Sites.Count(x => x.Site.ToLower() == siteName.ToLower()) == 0) { SiteCredentials credentials = new SiteCredentials(); if (credentials.UpdateData()) { Program.Settings.Sites = Program.Settings.Sites.Union(new SiteDefinition[] { new SiteDefinition() { Site = siteName, Data = credentials } }).ToArray(); Program.Settings.Save(); Console.WriteLine(MSG_INF_SITE_ADDED, siteName); } else { Console.WriteLine(MSG_ERR_BAD_CRED); } } else { Console.WriteLine(MSG_ERR_SITE_EXISTS, siteName); } }