/// <summary>
        /// Performs indentation using the specified document accessor.
        /// </summary>
        /// <param name="document">Object used for accessing the document line-by-line</param>
        /// <param name="indentationString">The string used for indentation.</param>
        /// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
        private void Indent(IDocumentAccessor document, string indentationString, bool keepEmptyLines)
        {
            if (document == null)
                throw new ArgumentNullException(nameof(document));

            IndentationSettings settings = new IndentationSettings();
            settings.IndentString = indentationString;
            settings.LeaveEmptyLines = keepEmptyLines;

            CSharpIndentationReformatter r = new CSharpIndentationReformatter();
            r.Reformat(document, settings);
        }
Example #2
0
        /// <summary>
        /// Performs indentation using the specified document accessor.
        /// </summary>
        /// <param name="document">Object used for accessing the document line-by-line</param>
        /// <param name="indentationString">The string used for indentation.</param>
        /// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
        private void Indent(IDocumentAccessor document, string indentationString, bool keepEmptyLines)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            IndentationSettings settings = new IndentationSettings();

            settings.IndentString    = indentationString;
            settings.LeaveEmptyLines = keepEmptyLines;

            CSharpIndentationReformatter r = new CSharpIndentationReformatter();

            r.Reformat(document, settings);
        }