示例#1
0
        public INFDataSet(IniFile infFile)
        {
            Sections = new Dictionary <string, INFSection>();

            foreach (string sectionName in infFile.GetSectionNames())
            {
                Dictionary <string, INFEntry> entries = new Dictionary <string, INFEntry>();
                INFSection section = new INFSection(sectionName, entries);

                foreach (string key in infFile.GetSectionKeys(sectionName))
                {
                    string   value = infFile.GetKeyValue(sectionName, key);
                    INFEntry entry = new INFEntry(section, key, value);
                    entries.Add(key, entry);
                }

                Sections.Add(sectionName, section);
            }
        }
示例#2
0
 public string GetValue(INFSection section, string key) =>
 GetEntry(section, key)?.Value;
示例#3
0
 public INFEntry(INFSection section, string key, string value)
 {
     Section = section;
     Key     = key;
     Value   = value;
 }
示例#4
0
 public INFEntry GetEntry(INFSection section, string key) =>
 section?.GetEntry(key);