コード例 #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="IniFile"/> class.
        /// </summary>
        /// <param name="options"><see cref="IniOptions"/> object that defines INI file's format, settings for both <see cref="O:MadMilkman.Ini.IniFile.Load">Load</see> and <see cref="O:MadMilkman.Ini.IniFile.Save">Save</see> methods.</param>
        public IniFile(IniOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            this.options  = new IniOptions(options);
            this.sections = new IniSectionCollection(this, options.SectionDuplicate, options.SectionNameCaseSensitive);
        }
コード例 #2
0
        private void WriteSections(IniSectionCollection sections)
        {
            if (sections.Count == 0)
            {
                return;
            }

            this.WriteFirstSection(sections[0]);

            for (int i = 1; i < sections.Count; i++)
            {
                this.WriteSection(sections[i]);
            }
        }