public static void Merge([NotNull] this IniSection current, [NotNull] IniSection other, IniMergeOption options) { foreach (var otherEntry in other.Entries) { var currentEntry = current.GetEntry(otherEntry.GetName()); if (currentEntry is null) { current.Entries.Add(otherEntry); } else { currentEntry.Merge(otherEntry, options); } } if ((options & IniMergeOption.OverwriteComments) != 0) { current.Comment.AddRange(other.Comment); } }
public static string GetValue([NotNull] this IniSection section, [NotNull] string key) { return(section.GetEntry(key)?.GetValue()); }