|
|
|
@ -502,11 +502,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -502,11 +502,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
internal void SelectNodes(IEnumerable<SharpTreeNode> nodes, bool ignoreCompilationRequests = false) |
|
|
|
|
{ |
|
|
|
|
this.ignoreDecompilationRequests = ignoreCompilationRequests; |
|
|
|
|
|
|
|
|
|
try |
|
|
|
|
internal void SelectNodes(IEnumerable<SharpTreeNode> nodes) |
|
|
|
|
{ |
|
|
|
|
// Ensure nodes exist
|
|
|
|
|
var nodesList = nodes.Select(n => FindNodeByPath(GetPathForNode(n), true)) |
|
|
|
@ -527,12 +523,6 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -527,12 +523,6 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
SelectedItems.Clear(); |
|
|
|
|
SelectedItems.AddRange(nodesList); |
|
|
|
|
} |
|
|
|
|
finally |
|
|
|
|
{ |
|
|
|
|
this.ignoreDecompilationRequests = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Retrieves a node using the .ToString() representations of its ancestors.
|
|
|
|
@ -699,6 +689,8 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -699,6 +689,8 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
#region Decompile (TreeView_SelectionChanged)
|
|
|
|
|
|
|
|
|
|
void TreeView_SelectionChanged() |
|
|
|
|
{ |
|
|
|
|
if (SelectedItems.Count > 0) |
|
|
|
|
{ |
|
|
|
|
var delayDecompilationRequestDueToContextMenu = Mouse.RightButton == MouseButtonState.Pressed; |
|
|
|
|
|
|
|
|
@ -710,6 +702,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -710,6 +702,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
{ |
|
|
|
|
ContextMenuProvider.ContextMenuClosed += ContextMenuClosed; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MessageBus.Send(this, new AssemblyTreeSelectionChangedEventArgs()); |
|
|
|
|
|
|
|
|
@ -728,13 +721,8 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -728,13 +721,8 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private bool ignoreDecompilationRequests; |
|
|
|
|
|
|
|
|
|
public void DecompileSelectedNodes(DecompilerTextViewState newState = null, bool recordHistory = true) |
|
|
|
|
{ |
|
|
|
|
if (ignoreDecompilationRequests) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
var activeTabPage = DockWorkspace.Instance.ActiveTabPage; |
|
|
|
|
|
|
|
|
|
if (recordHistory) |
|
|
|
@ -790,7 +778,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -790,7 +778,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
|
|
|
|
|
DockWorkspace.Instance.ActiveTabPage = newState.TabPage; |
|
|
|
|
|
|
|
|
|
SelectNodes(newState.TreeNodes, ignoreCompilationRequests: true); |
|
|
|
|
SelectNodes(newState.TreeNodes); |
|
|
|
|
DecompileSelectedNodes(newState.ViewState as DecompilerTextViewState, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -845,7 +833,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -845,7 +833,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
if (currentState != null) |
|
|
|
|
history.UpdateCurrent(new NavigationState(tabPage, currentState)); |
|
|
|
|
|
|
|
|
|
UnselectAll(ignoreCompilationRequests: true); |
|
|
|
|
UnselectAll(); |
|
|
|
|
|
|
|
|
|
history.Record(new NavigationState(tabPage, new ViewState { ViewedUri = e.Uri })); |
|
|
|
|
} |
|
|
|
@ -861,11 +849,9 @@ namespace ICSharpCode.ILSpy.AssemblyTree
@@ -861,11 +849,9 @@ namespace ICSharpCode.ILSpy.AssemblyTree
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void UnselectAll(bool ignoreCompilationRequests = false) |
|
|
|
|
private void UnselectAll() |
|
|
|
|
{ |
|
|
|
|
this.ignoreDecompilationRequests = ignoreCompilationRequests; |
|
|
|
|
SelectedItems.Clear(); |
|
|
|
|
this.ignoreDecompilationRequests = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<SharpTreeNode> GetTopLevelSelection() |
|
|
|
|