Look up the Analyzer "Remove" header through the resource key

Every other context-menu entry names its header by resource key so the
menu builder can localise it; this one shipped the raw string, which
WPF ILSpy did as well. The "Remove" string already exists in the resx.

#4042

Assisted-by: Claude:claude-fable-5-1:Claude Code
This commit is contained in:
Christoph Wille
2026-10-06 07:43:19 +02:00
parent 15c8cea75d
commit 85b85e0ea2
2 changed files with 5 additions and 3 deletions
@@ -26,6 +26,7 @@ using AwesomeAssertions;
using ICSharpCode.ILSpyX.TreeView;
using ICSharpCode.ILSpy;
using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.Analyzers;
using ICSharpCode.ILSpy.AppEnv;
using ICSharpCode.ILSpy.TreeNodes;
@@ -46,7 +47,7 @@ public class AnalyzerPaneRemoveTests
var registry = AppComposition.Current.GetExport<ContextMenuEntryRegistry>();
var entry = registry.Entries
.Single(e => e.Metadata.Header == "Remove"
.Single(e => e.Metadata.Header == nameof(Resources.Remove)
&& e.Value is RemoveAnalyzeContextMenuEntry)
.Value;
@@ -70,7 +71,7 @@ public class AnalyzerPaneRemoveTests
var registry = AppComposition.Current.GetExport<ContextMenuEntryRegistry>();
var entry = registry.Entries
.Single(e => e.Metadata.Header == "Remove"
.Single(e => e.Metadata.Header == nameof(Resources.Remove)
&& e.Value is RemoveAnalyzeContextMenuEntry)
.Value;
@@ -19,6 +19,7 @@
using System.Composition;
using System.Linq;
using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Analyzers
@@ -28,7 +29,7 @@ namespace ICSharpCode.ILSpy.Analyzers
/// pane root. Only visible on rows whose parent is the analyzer root (the per-entity
/// rows); search-tree-node headers and result rows can't be removed individually.
/// </summary>
[ExportContextMenuEntry(Header = "Remove", Icon = "Images/Delete", Order = 9200)]
[ExportContextMenuEntry(Header = nameof(Resources.Remove), Icon = "Images/Delete", Order = 9200)]
[Shared]
public sealed class RemoveAnalyzeContextMenuEntry : IContextMenuEntry
{