BlockScope
Disposable scope that manages code block indentation. Opens a block on creation and closes it on disposal.
internal readonly struct BlockScope : System.IDisposableConstructors
Section titled “Constructors”BlockScope(CodeWriter, bool)
Section titled “BlockScope(CodeWriter, bool)”Creates a new block scope that opens a code block and increments the indentation.
public BlockScope(CodeWriter writer, bool newLineOnDispose = false);writer
Section titled “writer”The code writer to write to.
newLineOnDispose
Section titled “newLineOnDispose”If true, a newline will be inserted when the block scope is disposed.
Methods
Section titled “Methods”Dispose()
Section titled “Dispose()”Closes the code block and decrements the indentation.
public void Dispose();