public INIFile(string file) : base(file) { sections = new List <INISection>(); using (StreamReader reader = File.OpenText(file)) { string line; INISection actsection = null; while ((line = reader.ReadLine()) != null) { if (line.Length == 0 || line[0] == ';') { continue; } line = line.Trim(' ', '\t'); if (line[0] == '[') { actsection = new INISection(line.Substring(1, line.Length - 2)); sections.Add(actsection); } else { string[] sep = line.Split('='); var prop = new INIProperty(sep[0], sep[1], actsection); if (actsection == null) { base.Add(prop); } else { actsection.Add(prop); } } } } }
public void Add(INIProperty item) { props.Add(item); }
public bool Contains(INIProperty item) { return(props.Contains(item)); }
public bool Remove(INIProperty item) { return(props.Remove(item)); }