Пример #1
0
        private static void Configs()
        {
            var manager = new IniManager("config.ini");

            manager.EnsureScheme(typeof(Config));

            Console.WriteLine(manager["password"].Value);
            Console.WriteLine(manager["someField"].Value);
            Console.WriteLine(manager["someProperty"].Value);
        }
Пример #2
0
        public void SchemeTest()
        {
            const string file = "test3.1.ini";

            File.WriteAllText(file, "key1 = false\nkey2 = 1338\n");

            var config = new IniManager(file);

            config.Load();

            config.EnsureScheme(typeof(Config));

            Assert.Equal(ulong.MaxValue, config["count"].ValueAs <ulong>());
            Assert.Equal(default, config["port"].ValueAs <int>());