protected string GetCurrent(MethodCallCounter counter) { List<InterceptCallInfo> info = new List<InterceptCallInfo>(); lock (counter.CurrentCalls.SyncRoot) { if (counter.CurrentCalls.Count == 0) return ""; foreach (InterceptCallInfo c in counter.CurrentCalls) info.Add(c); } StringBuilder sb = new StringBuilder(); sb.Append("<tr><td colspan=8 align=left><table class='grid' cellspacing=0 cellpadding=0 rules=all border=1 style='border-collapse:collapse'>"); sb.Append("<tr class='gridheader'>"); sb.Append("<td>Time</td>"); sb.Append("<td>Login</td>"); foreach (ParameterInfo pi in counter.MethodInfo.GetParameters()) sb.AppendFormat("<td>{0}</td>", pi.Name); sb.Append("</tr>"); foreach (InterceptCallInfo c in counter.CurrentCalls) { sb.AppendFormat("<tr>"); sb.AppendFormat("<td>{0}</td>", DateTime.Now - c.BeginCallTime); sb.AppendFormat("<td>{0}</td>", c.CurrentPrincipal.Identity.Name); foreach (object value in c.ParameterValues) { sb.AppendFormat("<td>"); sb.Append( value == null ? "<null>" : value is string ? "\"" + value.ToString().Replace("\n", "<br>\n") + "\"" : value is char ? "'" + value + "'" : value.ToString()); sb.AppendFormat("</td>"); } sb.AppendFormat("</tr>"); } sb.Append("</td></tr></table>"); return sb.ToString(); }