|
|
@ -418,17 +418,22 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
|
|
|
|
|
|
|
|
Root = assemblyListTreeNode; |
|
|
|
Root = assemblyListTreeNode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mainWindow = Application.Current?.MainWindow; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mainWindow == null) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (assemblyList.ListName == AssemblyListManager.DefaultListName) |
|
|
|
if (assemblyList.ListName == AssemblyListManager.DefaultListName) |
|
|
|
#if DEBUG
|
|
|
|
#if DEBUG
|
|
|
|
this.Title = $"ILSpy {DecompilerVersionInfo.FullVersion}"; |
|
|
|
mainWindow.Title = $"ILSpy {DecompilerVersionInfo.FullVersion}"; |
|
|
|
#else
|
|
|
|
#else
|
|
|
|
this.Title = "ILSpy"; |
|
|
|
mainWindow.Title = "ILSpy"; |
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
else |
|
|
|
else |
|
|
|
#if DEBUG
|
|
|
|
#if DEBUG
|
|
|
|
this.Title = $"ILSpy {DecompilerVersionInfo.FullVersion} - " + assemblyList.ListName; |
|
|
|
mainWindow.Title = $"ILSpy {DecompilerVersionInfo.FullVersion} - " + assemblyList.ListName; |
|
|
|
#else
|
|
|
|
#else
|
|
|
|
this.Title = "ILSpy - " + assemblyList.ListName; |
|
|
|
mainWindow.Title = "ILSpy - " + assemblyList.ListName; |
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -506,7 +511,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Ensure nodes exist
|
|
|
|
// Ensure nodes exist
|
|
|
|
var nodesList = nodes.Select(n => FindNodeByPath(GetPathForNode(n), true)) |
|
|
|
var nodesList = nodes.Select(n => FindNodeByPath(GetPathForNode(n), true)) |
|
|
|
.Where(n => n != null) |
|
|
|
.ExceptNullItems() |
|
|
|
.ToArray(); |
|
|
|
.ToArray(); |
|
|
|
|
|
|
|
|
|
|
|
if (!nodesList.Any() || nodesList.Any(n => n.AncestorsAndSelf().Any(a => a.IsHidden))) |
|
|
|
if (!nodesList.Any() || nodesList.Any(n => n.AncestorsAndSelf().Any(a => a.IsHidden))) |
|
|
@ -516,12 +521,22 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
|
|
|
|
|
|
|
|
if (SelectedItems.SequenceEqual(nodesList)) |
|
|
|
if (SelectedItems.SequenceEqual(nodesList)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Dispatcher.BeginInvoke(RefreshDecompiledView); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SelectedItems.Clear(); |
|
|
|
if (this.isNavigatingHistory) |
|
|
|
SelectedItems.AddRange(nodesList); |
|
|
|
{ |
|
|
|
|
|
|
|
SelectedItems.Clear(); |
|
|
|
|
|
|
|
SelectedItems.AddRange(nodesList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// defer selection change, so it does not interfere with the focus of the tab page.
|
|
|
|
|
|
|
|
Dispatcher.BeginInvoke(() => { |
|
|
|
|
|
|
|
SelectedItems.Clear(); |
|
|
|
|
|
|
|
SelectedItems.AddRange(nodesList); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -543,10 +558,8 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
ilSpyTreeNode.EnsureChildrenFiltered(); |
|
|
|
ilSpyTreeNode.EnsureChildrenFiltered(); |
|
|
|
node = node.Children.FirstOrDefault(c => c.ToString() == element); |
|
|
|
node = node.Children.FirstOrDefault(c => c.ToString() == element); |
|
|
|
} |
|
|
|
} |
|
|
|
if (returnBestMatch) |
|
|
|
|
|
|
|
return node ?? bestMatch; |
|
|
|
return returnBestMatch ? node ?? bestMatch : node; |
|
|
|
else |
|
|
|
|
|
|
|
return node; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -692,12 +705,10 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (SelectedItems.Count > 0) |
|
|
|
if (SelectedItems.Count > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
var activeTabPage = DockWorkspace.Instance.ActiveTabPage; |
|
|
|
|
|
|
|
|
|
|
|
if (!isNavigatingHistory) |
|
|
|
if (!isNavigatingHistory) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var activeTabPage = DockWorkspace.Instance.ActiveTabPage; |
|
|
|
|
|
|
|
var currentState = activeTabPage.GetState(); |
|
|
|
|
|
|
|
if (currentState != null) |
|
|
|
|
|
|
|
history.UpdateCurrent(new NavigationState(activeTabPage, currentState)); |
|
|
|
|
|
|
|
history.Record(new NavigationState(activeTabPage, SelectedItems)); |
|
|
|
history.Record(new NavigationState(activeTabPage, SelectedItems)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -705,7 +716,17 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
|
|
|
|
|
|
|
|
if (!delayDecompilationRequestDueToContextMenu) |
|
|
|
if (!delayDecompilationRequestDueToContextMenu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DecompileSelectedNodes(); |
|
|
|
var decompiledNodes = activeTabPage |
|
|
|
|
|
|
|
.GetState() |
|
|
|
|
|
|
|
?.DecompiledNodes |
|
|
|
|
|
|
|
?.Select(n => FindNodeByPath(GetPathForNode(n), true)) |
|
|
|
|
|
|
|
.ExceptNullItems() |
|
|
|
|
|
|
|
.ToArray() ?? []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!decompiledNodes.SequenceEqual(SelectedItems)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DecompileSelectedNodes(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -743,7 +764,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
} |
|
|
|
} |
|
|
|
if (newState?.ViewedUri != null) |
|
|
|
if (newState?.ViewedUri != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
NavigateTo(new(newState.ViewedUri, null), recordHistory: false); |
|
|
|
NavigateTo(new(newState.ViewedUri, null)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -780,7 +801,12 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
history.UpdateCurrent(new NavigationState(tabPage, state)); |
|
|
|
history.UpdateCurrent(new NavigationState(tabPage, state)); |
|
|
|
var newState = forward ? history.GoForward() : history.GoBack(); |
|
|
|
var newState = forward ? history.GoForward() : history.GoBack(); |
|
|
|
|
|
|
|
|
|
|
|
DockWorkspace.Instance.ActiveTabPage = newState.TabPage; |
|
|
|
TabPageModel activeTabPage = newState.TabPage; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!DockWorkspace.Instance.TabPages.Contains(activeTabPage)) |
|
|
|
|
|
|
|
DockWorkspace.Instance.AddTabPage(activeTabPage); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
DockWorkspace.Instance.ActiveTabPage = activeTabPage; |
|
|
|
|
|
|
|
|
|
|
|
SelectNodes(newState.TreeNodes); |
|
|
|
SelectNodes(newState.TreeNodes); |
|
|
|
} |
|
|
|
} |
|
|
@ -789,7 +815,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
|
|
|
|
|
|
|
|
public bool CanNavigateForward => history.CanNavigateForward; |
|
|
|
public bool CanNavigateForward => history.CanNavigateForward; |
|
|
|
|
|
|
|
|
|
|
|
internal void NavigateTo(RequestNavigateEventArgs e, bool recordHistory = true, bool inNewTabPage = false) |
|
|
|
internal void NavigateTo(RequestNavigateEventArgs e, bool inNewTabPage = false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (e.Uri.Scheme == "resource") |
|
|
|
if (e.Uri.Scheme == "resource") |
|
|
|
{ |
|
|
|
{ |
|
|
@ -830,7 +856,7 @@ namespace ICSharpCode.ILSpy.AssemblyTree |
|
|
|
|
|
|
|
|
|
|
|
void RecordHistory() |
|
|
|
void RecordHistory() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!recordHistory) |
|
|
|
if (isNavigatingHistory) |
|
|
|
return; |
|
|
|
return; |
|
|
|
TabPageModel tabPage = DockWorkspace.Instance.ActiveTabPage; |
|
|
|
TabPageModel tabPage = DockWorkspace.Instance.ActiveTabPage; |
|
|
|
var currentState = tabPage.GetState(); |
|
|
|
var currentState = tabPage.GetState(); |
|
|
|