public SectionEditContext AddSection(IniSectionData sectionData) { if (sectionData is null) { throw new ArgumentNullException(nameof(sectionData)); } var sectionEdit = new SectionEditContext(sectionData); Sections.Add(sectionData.Name, sectionEdit); return(sectionEdit); }
public EditContext(EditorConfigFile editorConfigFile, EditorConfigFileOptions?options = null) { _editorConfigFile = editorConfigFile ?? throw new ArgumentNullException(nameof(editorConfigFile)); _options = options ?? new EditorConfigFileOptions(); _lock = CreateLock(); // Make a copy of the data for editing _lines = _editorConfigFile._lines.ToList(); Global = new SectionEditContext(_editorConfigFile.Global); Sections = _editorConfigFile.Sections.ToDictionary(s => s.Name, s => new SectionEditContext(s)); }