示例#1
0
        private void InnerWrite <T>(INIFile f, T[] value, string fieldName, string defaultSection)
        {
            if (value == default)
            {
                return;
            }

            string s = INIAttributeExt.GetSection(Section, defaultSection);
            string k = SubsectionPrefix ?? INIAttributeExt.GetKey(Key, fieldName);

            string[] keys = new string[value.Length];
            for (int i = 0; i < value.Length; i++)
            {
                T o = value[i];
                keys[i] = fieldName + i.ToString();
                f.UpdateByAttribute(ref o, keys[i]);
            }
            f.SetValue(s, k, Parser.Write(keys));
        }
        private void InnerWrite <T, U>(INIFile f, Registry <T, U> registry, string fieldName, string defaultSection)
        {
            if (registry == default)
            {
                return;
            }

            string s = INIAttributeExt.GetSection(Section, defaultSection ?? fieldName);

            //string k = SubsectionPrefix ?? fieldName;
            //Registry<string, string> keylinks = new Registry<string, string>();
            foreach (T key in registry.GetKeys())
            {
                string skey = Parser.Write(key);
                U      o    = registry[key];
                string vkey = "{0}{1}".F(fieldName, skey);
                f.UpdateByAttribute(ref o, vkey);

                f.SetValue(s, skey, vkey);
            }
        }