Example #1
0
        private void UseBinder()
        {
            var builder = new ConfigurationBuilder();
            var current = Environment.CurrentDirectory;

            builder.AddXmlFile(current + "\\ConfigurationExperiments.exe.config");
            var configuration = builder.Build();

            //var converter2 = TypeDescriptor.GetConverter(typeof (Type));
            //var converter = new TypeNameConverter();
            //var d = typeof (double);
            TypeDescriptor.AddAttributes(typeof(Type), new TypeConverterAttribute(typeof(TypeNameConverter)));
            var converter = TypeDescriptor.GetConverter(typeof(Type));
            var a         = converter.ConvertFromInvariantString("System.Double");

            var model = new Configuration();

            configuration.Bind(model);
        }