|
|
|
|
|
|
namespace Unity.UIWidgets.foundation { |
|
|
|
{% macro DiagnosticableMixin(with) %} |
|
|
|
{% set className = 'DiagnosticableMixin' + with %} |
|
|
|
public class {{className}} : {{with}}, IDiagnosticable { |
|
|
|
protected {{className}}() { |
|
|
|
} |
|
|
|
|
|
|
|
public virtual string toStringShort() { |
|
|
|
return foundation_.describeIdentity(this); |
|
|
|
} |
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
return toString(); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual string toString(DiagnosticLevel minLevel = DiagnosticLevel.debug) { |
|
|
|
string fullString = null; |
|
|
|
D.assert(() => { |
|
|
|
fullString = toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine) |
|
|
|
.toString(minLevel: minLevel); |
|
|
|
return true; |
|
|
|
}); |
|
|
|
return fullString ?? toStringShort(); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual DiagnosticsNode toDiagnosticsNode( |
|
|
|
string name = null, |
|
|
|
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.sparse) { |
|
|
|
return new DiagnosticableNode<{{className}}>( |
|
|
|
name: name, value: this, style: style |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void debugFillProperties(DiagnosticPropertiesBuilder properties) { |
|
|
|
} |
|
|
|
} |
|
|
|
{% endmacro %} |
|
|
|
{{ DiagnosticableMixin('ChangeNotifier') }} |
|
|
|
} |
|
|
|
|