mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user