public JceDisplayer Display <K, V>(Dictionary <K, V> m, string fieldName) { ps(fieldName); if (null == m) { sb.Append("null").Append('\n'); return(this); } if (m.Count == 0) { sb.Append(m.Count).Append(", {}").Append('\n'); return(this); } sb.Append(m.Count).Append(", {").Append('\n'); JceDisplayer jd1 = new JceDisplayer(sb, _level + 1); JceDisplayer jd = new JceDisplayer(sb, _level + 2); foreach (KeyValuePair <K, V> en in m) { jd1.Display('(', null); jd.Display(en.Key, null); jd.Display(en.Value, null); jd1.Display(')', null); } Display('}', null); return(this); }
public JceDisplayer Display <T>(T[] v, string fieldName) { ps(fieldName); if (null == v) { sb.Append("null").Append('\n'); return(this); } if (v.Length == 0) { sb.Append(v.Length).Append(", []").Append('\n'); return(this); } sb.Append(v.Length).Append(", [").Append('\n'); JceDisplayer jd = new JceDisplayer(sb, _level + 1); foreach (T o in v) { jd.Display(o, null); } Display(']', null); return(this); }