/// <summary> /// Creates or Returns an existing <see cref="IniKey"/> /// </summary> /// <param name="key">Key Name</param> public IniKey CreateKey(string key) { IniKey get = GetKey(key); if (get != null) { return(get); } IniKey gen = new IniKey(key); _keys.Add(gen); return(gen); }
/// <summary> /// Merges two <see cref="IniFile" />s into One /// <para /> /// Conflicting values on this instance will be overriden by the second instance /// </summary> /// <param name="ini">Second Ini File</param> public void Merge(IniFile ini) { Comments.Append(ini.Comments.Comments.ToArray()); foreach (IniSection sOther in ini.Sections) { IniSection sThis = this[sOther.Section]; sThis.Comments.Append(sOther.Comments.Comments.ToArray()); foreach (IniKey kOther in sOther.Keys) { IniKey kThis = sThis[kOther.Key]; kThis.Comments.Append(kOther.Comments.Comments.ToArray()); kThis.Value = kOther.Value; } } }
/// <summary> /// Creates or Returns an existing <see cref="IniKey"/> /// </summary> /// <param name="key">Key Name</param> public IniKey CreateKey(string key) { IniKey get = GetKey(key); if (get != null) return get; IniKey gen = new IniKey(key); _keys.Add(gen); return gen; }