Пример #1
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;

            HlslIndentationReformatter r = new HlslIndentationReformatter();
            r.Reformat(document, settings);
        }
        /// <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;

            HlslIndentationReformatter r = new HlslIndentationReformatter();

            r.Reformat(document, settings);
        }