示例#1
0
        /// <summary>
        /// Saves the INI document by a specified IniWriter.
        /// </summary>
        /// <param name="iw"></param>
        public void Save(IniWriter iw)
        {
            if (iw == null)
            {
                throw new ArgumentNullException("iw");
            }

            iw.WriteDocument(this);
        }
示例#2
0
        /// <summary>
        /// Saves the INI document to the specified TextWriter.
        /// </summary>
        /// <param name="tw">The TextWriter to which you want to save.</param>
        /// <param name="formatting">Formatting options used to render the content.</param>
        public void Save(TextWriter tw, IniWriterFormattingSettings formatting)
        {
            if (tw == null)
            {
                throw new ArgumentNullException("tw");
            }

            if (formatting == null)
            {
                throw new ArgumentNullException("formatting");
            }

            using (IniWriter iw = new IniWriter(tw))
            {
                iw.SyntaxDefinition = this.SyntaxDefinition;
                iw.Formatting       = formatting;

                this.Save(iw);
            }
        }