Skip to content

Commit

Permalink
#1711: Support /navigateTo:none on command-line to disable the automa…
Browse files Browse the repository at this point in the history
…tic navigation on startup.
  • Loading branch information
dgrunwald committed Sep 27, 2019
1 parent 28ef411 commit d43d478
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ILSpy/MainWindow.xaml.cs
Expand Up @@ -323,6 +323,10 @@ async void NavigateOnLaunch(string navigateTo, string[] activeTreeViewPath, ILSp
}
}
}
} else if (navigateTo == "none") {
// Don't navigate anywhere; start empty.
// Used by ILSpy VS addin, it'll send us the real location to navigate to via IPC.
found = true;
} else {
IEntity mr = await Task.Run(() => FindEntityInRelevantAssemblies(navigateTo, relevantAssemblies));
if (mr != null && mr.ParentModule.PEFile != null) {
Expand All @@ -346,15 +350,15 @@ async void NavigateOnLaunch(string navigateTo, string[] activeTreeViewPath, ILSp
}
} else if (spySettings != null) {
SharpTreeNode node = null;
if (sessionSettings.ActiveTreeViewPath?.Length > 0) {
if (activeTreeViewPath?.Length > 0) {
foreach (var asm in assemblyList.GetAssemblies()) {
if (asm.FileName == sessionSettings.ActiveTreeViewPath[0]) {
if (asm.FileName == activeTreeViewPath[0]) {
// FindNodeByPath() blocks the UI if the assembly is not yet loaded,
// so use an async wait instead.
await asm.GetPEFileAsync().Catch<Exception>(ex => { });
}
}
node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true);
node = FindNodeByPath(activeTreeViewPath, true);
}
if (treeView.SelectedItem == initialSelection) {
if (node != null) {
Expand Down

0 comments on commit d43d478

Please sign in to comment.