From 39d5deb38c15e1ed1397e6009a021114af3dcac4 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 17 Aug 2024 10:09:31 +0200 Subject: [PATCH] Refresh AssemblyTreeNode tooltip after selecting a new PDB. --- ILSpy/Commands/SelectPdbContextMenuEntry.cs | 4 +++- ILSpy/TreeNodes/AssemblyTreeNode.cs | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ILSpy/Commands/SelectPdbContextMenuEntry.cs b/ILSpy/Commands/SelectPdbContextMenuEntry.cs index 1131229532..1d8da975f8 100644 --- a/ILSpy/Commands/SelectPdbContextMenuEntry.cs +++ b/ILSpy/Commands/SelectPdbContextMenuEntry.cs @@ -46,7 +46,9 @@ public async void Execute(TextViewContext context) await assembly.LoadDebugInfo(dlg.FileName); } - MainWindow.Instance.SelectNode(MainWindow.Instance.FindNodeByPath(new[] { assembly.FileName }, true)); + var node = (AssemblyTreeNode)MainWindow.Instance.FindNodeByPath(new[] { assembly.FileName }, true); + node.UpdateToolTip(); + MainWindow.Instance.SelectNode(node); MainWindow.Instance.RefreshDecompiledView(); } diff --git a/ILSpy/TreeNodes/AssemblyTreeNode.cs b/ILSpy/TreeNodes/AssemblyTreeNode.cs index 2449047c74..dc4de23bde 100644 --- a/ILSpy/TreeNodes/AssemblyTreeNode.cs +++ b/ILSpy/TreeNodes/AssemblyTreeNode.cs @@ -29,19 +29,19 @@ using ICSharpCode.Decompiler.CSharp.ProjectDecompiler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; +using ICSharpCode.ILSpy.Controls.TreeView; using ICSharpCode.ILSpy.Metadata; using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.ViewModels; using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX.FileLoaders; using ICSharpCode.ILSpyX.PdbProvider; -using ICSharpCode.ILSpy.Controls.TreeView; +using ICSharpCode.ILSpyX.TreeView; using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; using Microsoft.Win32; using TypeDefinitionHandle = System.Reflection.Metadata.TypeDefinitionHandle; -using ICSharpCode.ILSpyX.TreeView; namespace ICSharpCode.ILSpy.TreeNodes { @@ -168,6 +168,12 @@ public override object ToolTip { } } + public void UpdateToolTip() + { + tooltip = null; + RaisePropertyChanged(nameof(ToolTip)); + } + public override bool ShowExpander { get { return !LoadedAssembly.HasLoadError; } }