From 432377448e3e6a7e096328fe47f8af9c3baa60c7 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 20 Mar 2019 21:45:45 +0100 Subject: [PATCH] Add DecompilerTextView.ShowContent to allow showing arbitrary controls in the decompiler pane. --- ILSpy/TextView/DecompilerTextView.cs | 15 +++++++++++++++ ILSpy/TextView/DecompilerTextView.xaml | 1 + 2 files changed, 16 insertions(+) diff --git a/ILSpy/TextView/DecompilerTextView.cs b/ILSpy/TextView/DecompilerTextView.cs index bf5d7b63f..b99c768de 100644 --- a/ILSpy/TextView/DecompilerTextView.cs +++ b/ILSpy/TextView/DecompilerTextView.cs @@ -347,6 +347,9 @@ namespace ICSharpCode.ILSpy.TextView /// public void ShowNodes(AvalonEditTextOutput textOutput, ILSpyTreeNode[] nodes, IHighlightingDefinition highlighting = null) { + textEditor.Visibility = Visibility.Visible; + dynamicContent.Visibility = Visibility.Hidden; + dynamicContent.Content = null; // Cancel the decompilation task: if (currentCancellationTokenSource != null) { currentCancellationTokenSource.Cancel(); @@ -366,6 +369,10 @@ namespace ICSharpCode.ILSpy.TextView /// void ShowOutput(AvalonEditTextOutput textOutput, IHighlightingDefinition highlighting = null, DecompilerTextViewState state = null) { + textEditor.Visibility = Visibility.Visible; + dynamicContent.Visibility = Visibility.Hidden; + dynamicContent.Content = null; + Debug.WriteLine("Showing {0} characters of output", textOutput.TextLength); Stopwatch w = Stopwatch.StartNew(); @@ -413,6 +420,14 @@ namespace ICSharpCode.ILSpy.TextView Debug.WriteLine(" Updating folding: {0}", w.Elapsed); w.Restart(); } } + + public void ShowContent(ILSpyTreeNode[] nodes, object content) + { + textEditor.Visibility = Visibility.Collapsed; + dynamicContent.Visibility = Visibility.Visible; + dynamicContent.Content = content; + decompiledNodes = nodes; + } #endregion #region Decompile (for display) diff --git a/ILSpy/TextView/DecompilerTextView.xaml b/ILSpy/TextView/DecompilerTextView.xaml index 14368c54a..f2673fd61 100644 --- a/ILSpy/TextView/DecompilerTextView.xaml +++ b/ILSpy/TextView/DecompilerTextView.xaml @@ -16,6 +16,7 @@