Browse Source

#1711: Support /navigateTo:none on command-line to disable the automatic navigation on startup.

pull/1725/head
Daniel Grunwald 7 years ago
parent
commit
d43d4785cb
  1. 10
      ILSpy/MainWindow.xaml.cs

10
ILSpy/MainWindow.xaml.cs

@ -323,6 +323,10 @@ namespace ICSharpCode.ILSpy
} }
} }
} }
} 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 { } else {
IEntity mr = await Task.Run(() => FindEntityInRelevantAssemblies(navigateTo, relevantAssemblies)); IEntity mr = await Task.Run(() => FindEntityInRelevantAssemblies(navigateTo, relevantAssemblies));
if (mr != null && mr.ParentModule.PEFile != null) { if (mr != null && mr.ParentModule.PEFile != null) {
@ -346,15 +350,15 @@ namespace ICSharpCode.ILSpy
} }
} else if (spySettings != null) { } else if (spySettings != null) {
SharpTreeNode node = null; SharpTreeNode node = null;
if (sessionSettings.ActiveTreeViewPath?.Length > 0) { if (activeTreeViewPath?.Length > 0) {
foreach (var asm in assemblyList.GetAssemblies()) { 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, // FindNodeByPath() blocks the UI if the assembly is not yet loaded,
// so use an async wait instead. // so use an async wait instead.
await asm.GetPEFileAsync().Catch<Exception>(ex => { }); await asm.GetPEFileAsync().Catch<Exception>(ex => { });
} }
} }
node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true); node = FindNodeByPath(activeTreeViewPath, true);
} }
if (treeView.SelectedItem == initialSelection) { if (treeView.SelectedItem == initialSelection) {
if (node != null) { if (node != null) {

Loading…
Cancel
Save