|
|
|
@ -61,6 +61,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -61,6 +61,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
readonly UIElementGenerator uiElementGenerator; |
|
|
|
|
List<VisualLineElementGenerator> activeCustomElementGenerators = new List<VisualLineElementGenerator>(); |
|
|
|
|
FoldingManager foldingManager; |
|
|
|
|
ILSpyTreeNode[] decompiledNodes; |
|
|
|
|
|
|
|
|
|
DefinitionLookup definitionLookup; |
|
|
|
|
CancellationTokenSource currentCancellationTokenSource; |
|
|
|
@ -211,11 +212,21 @@ namespace ICSharpCode.ILSpy.TextView
@@ -211,11 +212,21 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ShowOutput
|
|
|
|
|
public void ShowText(AvalonEditTextOutput textOutput) |
|
|
|
|
{ |
|
|
|
|
ShowNodes(textOutput, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ShowNode(AvalonEditTextOutput textOutput, ILSpyTreeNode node, IHighlightingDefinition highlighting = null) |
|
|
|
|
{ |
|
|
|
|
ShowNodes(textOutput, new[] { node }, highlighting); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Shows the given output in the text view.
|
|
|
|
|
/// Cancels any currently running decompilation tasks.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Show(AvalonEditTextOutput textOutput, IHighlightingDefinition highlighting = null) |
|
|
|
|
public void ShowNodes(AvalonEditTextOutput textOutput, ILSpyTreeNode[] nodes, IHighlightingDefinition highlighting = null) |
|
|
|
|
{ |
|
|
|
|
// Cancel the decompilation task:
|
|
|
|
|
if (currentCancellationTokenSource != null) { |
|
|
|
@ -224,6 +235,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -224,6 +235,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
} |
|
|
|
|
this.nextDecompilationRun = null; // remove scheduled decompilation run
|
|
|
|
|
ShowOutput(textOutput, highlighting); |
|
|
|
|
decompiledNodes = nodes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -344,6 +356,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -344,6 +356,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
} |
|
|
|
|
ShowOutput(output); |
|
|
|
|
} |
|
|
|
|
decompiledNodes = context.TreeNodes; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -517,6 +530,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -517,6 +530,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
output.WriteLine(ex.ToString()); |
|
|
|
|
ShowOutput(output); |
|
|
|
|
} |
|
|
|
|
decompiledNodes = context.TreeNodes; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -579,11 +593,15 @@ namespace ICSharpCode.ILSpy.TextView
@@ -579,11 +593,15 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
|
|
|
|
|
public DecompilerTextViewState GetState() |
|
|
|
|
{ |
|
|
|
|
if (decompiledNodes == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
var state = new DecompilerTextViewState(); |
|
|
|
|
if (foldingManager != null) |
|
|
|
|
state.SaveFoldingsState(foldingManager.AllFoldings); |
|
|
|
|
state.VerticalOffset = textEditor.VerticalOffset; |
|
|
|
|
state.HorizontalOffset = textEditor.HorizontalOffset; |
|
|
|
|
state.DecompiledNodes = decompiledNodes; |
|
|
|
|
return state; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -594,6 +612,7 @@ namespace ICSharpCode.ILSpy.TextView
@@ -594,6 +612,7 @@ namespace ICSharpCode.ILSpy.TextView
|
|
|
|
|
private int FoldingsChecksum; |
|
|
|
|
public double VerticalOffset; |
|
|
|
|
public double HorizontalOffset; |
|
|
|
|
public ILSpyTreeNode[] DecompiledNodes; |
|
|
|
|
|
|
|
|
|
public void SaveFoldingsState(IEnumerable<FoldingSection> foldings) |
|
|
|
|
{ |
|
|
|
|