static public string IdentifyException(Exception ex) { if (ex == null) { return("<no error>"); } return(Format("{0} ({1})", ex.GetType().Name, AvTrace.AntiFormat(ex.Message))); }
static public string Identify(object o) { if (o == null) { return("<null>"); } Type type = o.GetType(); if (type.IsPrimitive || type.IsEnum) { return(Format("'{0}'", o)); } string s = o as String; if (s != null) { return(Format("'{0}'", AvTrace.AntiFormat(s))); } NamedObject n = o as NamedObject; if (n != null) { return(AvTrace.AntiFormat(n.ToString())); } ICollection ic = o as ICollection; if (ic != null) { return(Format("{0} (hash={1} Count={2})", type.Name, AvTrace.GetHashCodeHelper(o), ic.Count)); } return(Format("{0} (hash={1})", type.Name, AvTrace.GetHashCodeHelper(o))); }
public void AppendFormat(string message, string arg1, string arg2) { _sb.AppendFormat(CultureInfo.InvariantCulture, message, new object[] { AvTrace.AntiFormat(arg1), AvTrace.AntiFormat(arg2) }); }