public static object DumpSort <T>(this T obj, int depth) { var metaData = TypeMetadataProviderBase.GetMetadataProvider(obj); var renderer = FragmentBase.GetFragment(metaData); Renderers.Add(() => renderer.Render(depth)); if (webBrowser == null) { webBrowser = new WebBrowser(); PanelManager.DisplayWpfElement(webBrowser, PanelName); PanelManager.GetOutputPanel(PanelName).QueryEnded += OnQueryEnded; } return(obj); }
static void OnQueryEnded(object sender, EventArgs eventArgs) { PanelManager.GetOutputPanel(PanelName).QueryEnded -= OnQueryEnded; var document = new StringJoiner( LinqPadUtilResources.DumpExtendedHead, LinqPadUtilResources.DumpExtendedFoot); foreach (var renderer in Renderers) { document.AppendFunc(renderer); } document.Document.Replace("{script}", LinqPadUtilResources.jquery_1_11_1_min) .Replace("{tablesorter}", LinqPadUtilResources.jquery_tablesorter_min) .Replace("{firebug}", LinqPadUtilResources.firebug_lite_compressed); webBrowser.NavigateToString(document.ToString()); Renderers.Clear(); webBrowser = null; }