AvalonStudio.Languages.CSharp.CSharpIndentationStrategy.Indent C# (CSharp) Method

Indent() public method

Performs indentation using the specified document accessor.
public Indent ( IDocumentAccessor document, bool keepEmptyLines, int caretIndex ) : int
document IDocumentAccessor Object used for accessing the document line-by-line
keepEmptyLines bool Specifies whether empty lines should be kept
caretIndex int
return int
        public int Indent(IDocumentAccessor document, bool keepEmptyLines, int caretIndex)
        {
            if (document == null)
                throw new ArgumentNullException(nameof(document));
            var settings = new IndentationSettings();
            settings.IndentString = IndentationString;
            settings.LeaveEmptyLines = keepEmptyLines;

            var r = new IndentationReformatter();
            r.Reformat(document, settings);

            return caretIndex;
        }
CSharpIndentationStrategy