您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

70 行
2.5 KiB

using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Unity.UIWidgets.foundation {
{% macro DiagnosticableTreeMixin(with) %}
{% set className = 'DiagnosticableTreeMixin' + with %}
public class {{className}} : {{with}}, DiagnosticableTreeMixin {
protected {{className}}() {
}
public virtual string toString( DiagnosticLevel minLevel = DiagnosticLevel.info ) {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
}
public virtual string toStringShallow(
string joiner = ", ",
DiagnosticLevel minLevel = DiagnosticLevel.debug
) {
if (foundation_.kReleaseMode) {
return toString();
}
string shallowString = "";
D.assert(() => {
var result = new StringBuilder();
result.Append(toString());
result.Append(joiner);
DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder();
debugFillProperties(builder);
result.Append(string.Join(joiner,
builder.properties.Where(n => !n.isFiltered(minLevel)).Select(n => n.ToString()).ToArray())
);
shallowString = result.ToString();
return true;
});
return shallowString;
}
public virtual string toStringDeep(
string prefixLineOne = "",
string prefixOtherLines = null,
DiagnosticLevel minLevel = DiagnosticLevel.debug
) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel);
}
public virtual string toStringShort() {
return foundation_.describeIdentity(this);
}
public virtual DiagnosticsNode toDiagnosticsNode(
string name = null,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.sparse) {
return new DiagnosticableTreeNode(
name: name,
value: this,
style: style
);
}
public virtual List<DiagnosticsNode> debugDescribeChildren()
{
return new List<DiagnosticsNode>();
}
public virtual void debugFillProperties(DiagnosticPropertiesBuilder properties) { }
}
{% endmacro %}
{{ DiagnosticableTreeMixin('ChangeNotifier') }}
}