static string DumpIDictionary(object o) { var dictionary = (IDictionary)o; return(dictionary .Keys .Cast <object>() .Select(key => "[" + Tracer.Dump(key) + "] " + Tracer.Dump(dictionary[key])) .Stringify("\n") .Surround("{", "}")); }
static string Format(MemberInfo memberInfo, object x) { try { return(memberInfo.Name + "=" + Tracer.Dump(x.InvokeValue(memberInfo))); } catch (Exception) { return("<not implemented>"); } }
protected static T ReturnMethodDump <T>(T rv, bool breakExecution = true) { if (IsMethodDumpTraceActive) { Tracer.IndentEnd(); Tracer.Line(Tracer.MethodHeader(stackFrameDepth: 1) + "[returns] " + Tracer.Dump(rv)); if (breakExecution) { Tracer.TraceBreak(); } } return(rv); }
/// <summary> /// generate dump string to be shown in debug windows /// </summary> /// <returns> </returns> public virtual string DebuggerDump() { return(Tracer.Dump(this)); }