/// <summary> /// Gets the <c>ConverterSettings</c> object from the appSettings element. /// </summary> /// <returns>Returns the <c>ConverterSettings</c> object.</returns> private static IConverterSettings GetFromAppSettings() { var processUrl = ConfigurationManager.AppSettings["ProcessUrl"]; bool result; var useHeader = Boolean.TryParse(ConfigurationManager.AppSettings["UseHeader"], out result) && result; var apiKey = ConfigurationManager.AppSettings["ApiKey"]; if (String.IsNullOrWhiteSpace(processUrl) || String.IsNullOrWhiteSpace(apiKey)) { return(null); } var settings = new ConverterSettings { Basic = new BasicElement { ProcessUrl = processUrl, UseHeader = useHeader, ApiKey = new ApiKeyElement { Value = apiKey, }, } }; return(settings); }
/// <summary> /// Gets the <c>ConverterSettings</c> object from the appSettings element. /// </summary> /// <returns>Returns the <c>ConverterSettings</c> object.</returns> private static IConverterSettings GetFromAppSettings() { var processUrl = ConfigurationManager.AppSettings["ProcessUrl"]; bool result; var useHeader = Boolean.TryParse(ConfigurationManager.AppSettings["UseHeader"], out result) && result; var apiKey = ConfigurationManager.AppSettings["ApiKey"]; if (String.IsNullOrWhiteSpace(processUrl) || String.IsNullOrWhiteSpace(apiKey)) { return null; } var settings = new ConverterSettings { Basic = new BasicElement { ProcessUrl = processUrl, UseHeader = useHeader, ApiKey = new ApiKeyElement { Value = apiKey, }, } }; return settings; }