using System.Configuration;

namespace Valg.EVA.Skanning.Configuration
{
    public class ConfigurationFileProvider : IConfigurationFileProvider
    {
        private readonly string configurationFileName;

        public ConfigurationFileProvider(string configurationFileName)
        {
            this.configurationFileName = configurationFileName;
        }

        public System.Configuration.Configuration GetConfiguration()
        {
            var exeConfigurationFileMap = new ExeConfigurationFileMap { ExeConfigFilename = configurationFileName };
            return ConfigurationManager.OpenMappedExeConfiguration(exeConfigurationFileMap, ConfigurationUserLevel.None);
        }
    }
}
