Browse Source

Add DecompilerTextView.ShowContent to allow showing arbitrary controls in the decompiler pane.

pull/1716/head
Siegfried Pammer 7 years ago
parent
commit
432377448e
  1. 15
      ILSpy/TextView/DecompilerTextView.cs
  2. 1
      ILSpy/TextView/DecompilerTextView.xaml

15
ILSpy/TextView/DecompilerTextView.cs

@ -347,6 +347,9 @@ namespace ICSharpCode.ILSpy.TextView
/// </summary> /// </summary>
public void ShowNodes(AvalonEditTextOutput textOutput, ILSpyTreeNode[] nodes, IHighlightingDefinition highlighting = null) 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: // Cancel the decompilation task:
if (currentCancellationTokenSource != null) { if (currentCancellationTokenSource != null) {
currentCancellationTokenSource.Cancel(); currentCancellationTokenSource.Cancel();
@ -366,6 +369,10 @@ namespace ICSharpCode.ILSpy.TextView
/// </summary> /// </summary>
void ShowOutput(AvalonEditTextOutput textOutput, IHighlightingDefinition highlighting = null, DecompilerTextViewState state = null) 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); Debug.WriteLine("Showing {0} characters of output", textOutput.TextLength);
Stopwatch w = Stopwatch.StartNew(); Stopwatch w = Stopwatch.StartNew();
@ -413,6 +420,14 @@ namespace ICSharpCode.ILSpy.TextView
Debug.WriteLine(" Updating folding: {0}", w.Elapsed); w.Restart(); 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 #endregion
#region Decompile (for display) #region Decompile (for display)

1
ILSpy/TextView/DecompilerTextView.xaml

@ -16,6 +16,7 @@
<Style TargetType="{x:Type Button}" /> <Style TargetType="{x:Type Button}" />
</ae:TextEditor.Resources> </ae:TextEditor.Resources>
</ae:TextEditor> </ae:TextEditor>
<ContentControl Name="dynamicContent" />
<Border Name="waitAdorner" Background="#C0FFFFFF" Visibility="Collapsed"> <Border Name="waitAdorner" Background="#C0FFFFFF" Visibility="Collapsed">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock FontSize="14pt">Decompiling...</TextBlock> <TextBlock FontSize="14pt">Decompiling...</TextBlock>

Loading…
Cancel
Save