示例#1
0
 private void AppendObjectString(StringBuilder sb, object value, int maxOututLength)
 {
     try
     {
         if (value is ICollection)
         {
             ReflectionUtils.AppendCollectionString((ICollection)value, maxOututLength, sb);
         }
         else if (value is Delegate)
         {
             sb.AppendFormat("Delegate={0}", ((Delegate)value).Method.Name);
         }
         else
         {
             sb.AppendFormat("{0}", (value == null) ? "null" : value);
         }
         if (sb.Length > maxOututLength)
         {
             sb.Remove(maxOututLength, sb.Length - maxOututLength);
             sb.Append(" ...");
         }
     }
     catch (Exception)
     {
     }
 }