|
|
|
|
|
|
prefixOtherLinesRootNode: "" |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
class _PrefixedStringBuilder { |
|
|
|
internal _PrefixedStringBuilder(string prefixLineOne, string prefixOtherLines) { |
|
|
|
this.prefixLineOne = prefixLineOne; |
|
|
|
|
|
|
internal _NoDefaultValue() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class _NullDefaultValue { |
|
|
|
internal _NullDefaultValue() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public static readonly object kNoDefaultValue = new _NoDefaultValue(); |
|
|
|
|
|
|
|
public static readonly object kNullDefaultValue = new _NullDefaultValue(); |
|
|
|
|
|
|
protected DiagnosticsNode( |
|
|
|
string name = null, |
|
|
|
DiagnosticsTreeStyle? style = null, |
|
|
|
String linePrefix = null, |
|
|
|
bool showName = true, |
|
|
|
bool showSeparator = true |
|
|
|
) { |
|
|
|
|
|
|
_style = style; |
|
|
|
_showName = showName; |
|
|
|
this.showSeparator = showSeparator; |
|
|
|
this.linePrefix = linePrefix; |
|
|
|
} |
|
|
|
|
|
|
|
public static DiagnosticsNode message( |
|
|
|
|
|
|
get { return null; } |
|
|
|
} |
|
|
|
|
|
|
|
readonly string linePrefix; |
|
|
|
|
|
|
|
public abstract object valueObject { get; } |
|
|
|
|
|
|
|
public virtual DiagnosticsTreeStyle? style { |
|
|
|
|
|
|
readonly DiagnosticsTreeStyle? _style; |
|
|
|
|
|
|
|
public bool allowWrap { |
|
|
|
get { return false; } |
|
|
|
} |
|
|
|
|
|
|
|
public bool allowNameWrap { |
|
|
|
get { return false; } |
|
|
|
} |
|
|
|
|
|
|
|
public bool allowTruncate { |
|
|
|
get { return false; } |
|
|
|
} |
|
|
|
|
|
|
|
public abstract List<DiagnosticsNode> getProperties(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return builder.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class DiagnosticsBlock : DiagnosticsNode { |
|
|
|
public DiagnosticsBlock( |
|
|
|
string name, |
|
|
|
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.whitespace, |
|
|
|
bool showName = true, |
|
|
|
bool showSeparator = true, |
|
|
|
string linePrefix = null, |
|
|
|
object value = null, |
|
|
|
string description = null, |
|
|
|
DiagnosticLevel level = DiagnosticLevel.info, |
|
|
|
bool allowTruncate = false, |
|
|
|
List<DiagnosticsNode> children = null, |
|
|
|
List<DiagnosticsNode> properties = null |
|
|
|
) : base( |
|
|
|
name: name, |
|
|
|
style: style, |
|
|
|
showName: showName && name != null, |
|
|
|
showSeparator: showSeparator, |
|
|
|
linePrefix: linePrefix |
|
|
|
) { |
|
|
|
_description = description; |
|
|
|
_children = children ?? new List<DiagnosticsNode>(); |
|
|
|
_properties = properties ?? new List<DiagnosticsNode>(); |
|
|
|
} |
|
|
|
|
|
|
|
readonly List<DiagnosticsNode> _children; |
|
|
|
readonly List<DiagnosticsNode> _properties; |
|
|
|
|
|
|
|
|
|
|
|
new readonly DiagnosticLevel level; |
|
|
|
readonly string _description; |
|
|
|
public override object valueObject { get; } |
|
|
|
|
|
|
|
readonly bool allowTruncate; |
|
|
|
|
|
|
|
public override List<DiagnosticsNode> getChildren() => _children; |
|
|
|
|
|
|
|
public override List<DiagnosticsNode> getProperties() => _properties; |
|
|
|
|
|
|
|
public override string toDescription(TextTreeConfiguration parentConfiguration = null) => _description; |
|
|
|
} |
|
|
|
|
|
|
|
public class MessageProperty : DiagnosticsProperty<object> { |
|
|
|
|
|
|
return new List<DiagnosticsNode>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static partial class foundation_ { |
|
|
|
public static string shortHash(object o) { |
|
|
|
return (o.GetHashCode() & 0xFFFFF).ToString("X").PadLeft(5, '0'); |
|
|
|