Exemplo n.º 1
0
        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("{", "}"));
        }
Exemplo n.º 2
0
 static string Format(MemberInfo memberInfo, object x)
 {
     try
     {
         return(memberInfo.Name + "=" + Tracer.Dump(x.InvokeValue(memberInfo)));
     }
     catch (Exception)
     {
         return("<not implemented>");
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 /// <summary>
 ///     generate dump string to be shown in debug windows
 /// </summary>
 /// <returns> </returns>
 public virtual string DebuggerDump()
 {
     return(Tracer.Dump(this));
 }