﻿using System.Collections.Generic;
using Codeo.Parameter.Contract;
using Codeo.Parameter.Impl;
using Ninject.Modules;

namespace Codeo.Parameter
{
    public class ParameterModule : NinjectModule
    {
        private readonly KeyValuePair<string, string>[] _files;

        public ParameterModule(params KeyValuePair<string, string>[] files)
        {
            _files = files;
        }

        public override void Load()
        {
            foreach (KeyValuePair<string, string> f in _files )
            {
                Bind<IParameterReaderService>().To<XmlParameterReaderService>().InSingletonScope().Named(f.Key).WithConstructorArgument(f.Value);
            }
           
        }
    }
}
