private static void SetCredentials(WebClient wc)
        {
            var userName = LocalConfigStore.GetConfigServiceUser();
            var password = LocalConfigStore.GetConfigServicepassword();

            if (userName.ContainsCharacters() && password.ContainsCharacters())
            {
                wc.Credentials = new NetworkCredential(userName, password, "EAZYPORTCONFIG");
            }
        }
 private ConfigurationSet GetConfigurationSet(string setName, string environment)
 {
     using (var wc = new WebClient())
     {
         //Logging.DebugMessage("Web client obtained");
         SetCredentials(wc);
         var url = string.Format("{0}/api/ConfigReader/{1}?env={2}", LocalConfigStore.GetConfigServiceUrl(), setName, environment);
         //Logging.DebugMessage(string.Format("Reading settings from '{0}'", url));
         var payload = wc.DownloadString(url);
         //Logging.DebugMessage("Config set loaded");
         return(GetConfigurationFromString(payload));
     }
 }
 public FileConfigurationReader()
 {
     if (ConfigurationData.IsNull())
     {
         if (File.Exists(LocalConfigStore.GetConfigFilePath()))
         {
             ConfigurationData = Deserializer <ConfigurationSets> .GetInstanceFromFile(LocalConfigStore.GetConfigFilePath());
         }
         else
         {
             ConfigurationData = new ConfigurationSets();
             Write();
         }
     }
 }
 private void Write()
 {
     ConfigurationData.SerializeToFile(LocalConfigStore.GetConfigFilePath(), true);
 }