示例#1
0
 /// <summary>
 ///     get a html-table representation of a given Object.
 /// </summary>
 /// <param name = "obj">the Object to dump</param>
 /// <param name = "flags">BindingFlags to use for reflection</param>
 /// <param name = "maxArrayElements">Number of elements to show for IEnumerables</param>
 /// <returns></returns>
 public static String ToHtmlTable(this Object obj,
                                  BindingFlags flags =
                                  BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
                                  int maxArrayElements = 5)
 {
     return(ToHtmlTableInternal(obj.ToXElement(flags, maxArrayElements), 0).Aggregate(String.Empty,
                                                                                      (str, el) => str + el));
 }
示例#2
0
 /// <summary>
 ///     get a String representation of a given Object.
 /// </summary>
 /// <param name = "obj">the Object to dump</param>
 /// <param name = "flags">BindingFlags to use for reflection</param>
 /// <param name = "maxArrayElements">Number of elements to show for IEnumerables</param>
 /// <returns></returns>
 public static String ToStringDump(this Object obj,
                                   BindingFlags flags =
                                   BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
                                   int maxArrayElements = 5)
 {
     return
         (ToStringDumpInternal(obj.ToXElement(flags, maxArrayElements)).Aggregate(new StringBuilder(),
                                                                                  (sb, elem) => sb.Append(elem)).
          ToString());
 }