ExplanationBuilder
Namespace: SnowBank.Runtime · class
Builder for generating text descriptions of types that implement ICanExplain
Constructors
ExplanationBuilder
ExplanationBuilder(TextWriter output, bool recursive = true, string prefix = null)
Constructs a new ExplanationBuilder
Properties
Depth
int Depth { get; }
Current depth level (add a TAB ('\t') for each depth level
Indentation
string Indentation { get; }
Current indentation level
Output
TextWriter Output { get; }
Destination buffer
Prefix
string Prefix { get; }
Prefix added to the beginning of each line
Recursive
bool Recursive { get; }
If true (default), also explain any children of this node; otherwise, only give a brief one-line summary.
Methods
Enter
void Enter()
Increase the indentation level
ExplainChild
void ExplainChild<TExplainable>(TExplainable child, string label = null)
Explain a child of the current instance
ExplainChildren
void ExplainChildren<TExplainable>(ReadOnlySpan<TExplainable> children)
Explain one or more children of the current instance
void ExplainChildren<TExplainable>(TExplainable[] children)
Explain one or more children of the current instance
void ExplainChildren<TExplainable>(IEnumerable<TExplainable> children)
Explain one or more children of the current instance
Leave
void Leave()
Decrease the indentation level
WriteChildrenLine
void WriteChildrenLine(string message)
Appends a new line to the buffer, with an extra indentation level
void WriteChildrenLine(ref DefaultInterpolatedStringHandler message)
Appends a new line to the buffer, with an extra indentation level
WriteLine
void WriteLine(string message)
Appends a new line to the buffer
void WriteLine(ref DefaultInterpolatedStringHandler message)
Appends a new line to the buffer