/// <summary> /// 指定した名前とアイテムコレクションを持つセクションを末尾に追加する。 /// </summary> /// <param name="name"> /// セクション名。先頭と末尾の空白文字は除去される。 /// 制御文字および '\r', '\n', '[', ']' が含まれていてはならない。 /// </param> /// <param name="items">アイテムコレクション。</param> /// <returns>追加されたセクション。</returns> public IniSection Add(string name, IniItemCollection items) { var section = new IniSection(name, items); this.Add(section); return(section); }
/// <summary> /// 指定した名前と空のアイテムコレクションを持つセクションを挿入する。 /// </summary> /// <param name="index">挿入先のインデックス。</param> /// <param name="name"> /// セクション名。先頭と末尾の空白文字は除去される。 /// 制御文字および '\r', '\n', '[', ']' が含まれていてはならない。 /// </param> /// <param name="items">アイテムコレクション。</param> /// <returns>挿入されたセクション。</returns> public IniSection Insert(int index, string name, IniItemCollection items) { var section = new IniSection(name, items); this.Insert(index, section); return(section); }
/// <summary> /// コンストラクタ。 /// </summary> /// <param name="name"> /// セクション名。先頭と末尾の空白文字は除去される。 /// 制御文字および '\r', '\n', '[', ']' が含まれていてはならない。 /// </param> /// <param name="items">アイテムコレクション。</param> public IniSection(string name, IniItemCollection items) { this.Name = FormatName(name, nameof(name)); this.Items = items ?? throw new ArgumentNullException(nameof(items)); }