public static IHtmlString ContextInfo(TextWriter writer) { var res = new StringBuilder(); res.AppendLine("<pre style='margin:10px'>"); res.AppendLine("TextWriter"); res.AppendLine("Type: {0}", writer.GetType().Name); res.AppendLine("TextWriter.GetHashCode:{0}", writer.GetHashCode()); res.AppendLine("TextWriter.ToString:{0}", writer.ToString()); res.AppendLine("</pre>"); return new MvcHtmlString(res.ToString()); }