예제 #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("{", "}"));
        }
예제 #2
0
파일: Dumper.cs 프로젝트: hahoyer/factorio
 static string Format(MemberInfo memberInfo, object x)
 {
     try
     {
         return(memberInfo.Name + "=" + Tracer.Dump(x.InvokeValue(memberInfo)));
     }
     catch (Exception)
     {
         return("<not implemented>");
     }
 }
예제 #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);
 }
예제 #4
0
 /// <summary>
 ///     generate dump string to be shown in debug windows
 /// </summary>
 /// <returns> </returns>
 public virtual string DebuggerDump()
 {
     return(Tracer.Dump(this));
 }