예제 #1
0
        /// <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);
        }
예제 #2
0
파일: IniFile.cs 프로젝트: TokcDK/ExIni
 /// <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;
         }
     }
 }
예제 #3
0
        /// <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;
        }