Ejemplo n.º 1
0
        public static QuerySortOrder FromIniSection(IniSection iniSection)
        {
            var iniSortOrder = iniSection.Deserialize <IniSortOrder>();

            Debug.WriteLine($"{iniSortOrder}");
            return(new QuerySortOrder(iniSortOrder.Order, iniSortOrder.Asc != 0));
        }
Ejemplo n.º 2
0
        private static void Serialize()
        {
            IniFile    file    = new IniFile();
            IniSection section = file.Sections.Add("User's Character");

            GameCharacter character = new GameCharacter();

            character.Name    = "John";
            character.Attack  = 5.5;
            character.Defence = 1;
            character.Health  = 75;

            // Serialize GameCharacter object into section's keys.
            section.Serialize(character);

            // Deserialize section into GameCharacter object.
            GameCharacter savedCharacter = section.Deserialize <GameCharacter>();

            Console.WriteLine(section.Keys["Name"].Value);
            Console.WriteLine(savedCharacter.Name);
            Console.WriteLine(section.Keys["Sword"].Value);
            Console.WriteLine(savedCharacter.Attack);
            Console.WriteLine(section.Keys["Shield"].Value);
            Console.WriteLine(savedCharacter.Defence);
        }
        public static QueryAdvancedConfig FromIniSection(IniSection iniSection)
        {
            var cfg = iniSection.Deserialize <IniAdvancedConfig>();

            return(new QueryAdvancedConfig(cfg.ConditionsCount, cfg.OrdersCount));
        }
Ejemplo n.º 4
0
        public static QueryCondition FromIniSection(IniSection iniSection)
        {
            var iniCondition = iniSection.Deserialize <IniCondition>();

            return(new QueryCondition(iniCondition.DBField, iniCondition.Value, (ConditionType)iniCondition.Condition));
        }