Browse Source

Remove Viewbox special cases.

pull/1725/head
Siegfried Pammer 6 years ago
parent
commit
9c0200a296
  1. 2
      ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs
  2. 2
      ILSpy/Commands/DecompileInNewViewCommand.cs
  3. 14
      ILSpy/ContextMenuEntry.cs
  4. 28
      ILSpy/MainWindow.xaml.cs

2
ILSpy/Analyzers/RemoveAnalyzeContextMenuEntry.cs

@ -20,7 +20,7 @@ using System.Linq; @@ -20,7 +20,7 @@ using System.Linq;
namespace ICSharpCode.ILSpy.Analyzers
{
[ExportContextMenuEntry(Header = "Remove", Icon = "images/Delete.png", Category = "Analyze", Order = 200)]
[ExportContextMenuEntry(Header = "Remove", Icon = "images/Delete", Category = "Analyze", Order = 200)]
internal sealed class RemoveAnalyzeContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

2
ILSpy/Commands/DecompileInNewViewCommand.cs

@ -23,7 +23,7 @@ using ICSharpCode.ILSpy.TreeNodes; @@ -23,7 +23,7 @@ using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy.Analyzers
{
[ExportContextMenuEntry(Header = nameof(Resources.DecompileToNewPanel), Icon = "images/Search.png", Category = nameof(Resources.Analyze), Order = 90)]
[ExportContextMenuEntry(Header = nameof(Resources.DecompileToNewPanel), Icon = "images/Search", Category = nameof(Resources.Analyze), Order = 90)]
internal sealed class DecompileInNewViewCommand : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)

14
ILSpy/ContextMenuEntry.cs

@ -222,15 +222,11 @@ namespace ICSharpCode.ILSpy @@ -222,15 +222,11 @@ namespace ICSharpCode.ILSpy
menuItem.Header = MainWindow.GetResourceString( entryPair.Metadata.Header);
menuItem.InputGestureText = entryPair.Metadata.InputGestureText;
if (!string.IsNullOrEmpty(entryPair.Metadata.Icon)) {
object image = Images.Load(entryPair.Value, entryPair.Metadata.Icon);
if (!(image is Viewbox)) {
image = new Image {
Width = 16,
Height = 16,
Source = (ImageSource)image
};
}
menuItem.Icon = image;
menuItem.Icon = new Image {
Width = 16,
Height = 16,
Source = Images.Load(entryPair.Value, entryPair.Metadata.Icon)
};
}
if (entryPair.Value.IsEnabled(context)) {
menuItem.Click += delegate { entry.Execute(context); };

28
ILSpy/MainWindow.xaml.cs

@ -142,19 +142,15 @@ namespace ICSharpCode.ILSpy @@ -142,19 +142,15 @@ namespace ICSharpCode.ILSpy
Button MakeToolbarItem(Lazy<ICommand, IToolbarCommandMetadata> command)
{
object image = Images.Load(command.Value, command.Metadata.ToolbarIcon);
if (!(image is Viewbox)) {
image = new Image {
Width = 16,
Height = 16,
Source = (ImageSource)image
};
}
return new Button {
Command = CommandWrapper.Unwrap(command.Value),
ToolTip = Properties.Resources.ResourceManager.GetString(command.Metadata.ToolTip),
Tag = command.Metadata.Tag,
Content = image
Content = new Image {
Width = 16,
Height = 16,
Source = Images.Load(command.Value, command.Metadata.ToolbarIcon)
}
};
}
#endregion
@ -180,15 +176,11 @@ namespace ICSharpCode.ILSpy @@ -180,15 +176,11 @@ namespace ICSharpCode.ILSpy
if (!string.IsNullOrEmpty(GetResourceString(entry.Metadata.Header)))
menuItem.Header = GetResourceString(entry.Metadata.Header);
if (!string.IsNullOrEmpty(entry.Metadata.MenuIcon)) {
object image = Images.Load(entry.Value, entry.Metadata.MenuIcon);
if (!(image is Viewbox)) {
image = new Image {
Width = 16,
Height = 16,
Source = (ImageSource)image
};
}
menuItem.Icon = image;
menuItem.Icon = new Image {
Width = 16,
Height = 16,
Source = Images.Load(entry.Value, entry.Metadata.MenuIcon)
};
}
menuItem.IsEnabled = entry.Metadata.IsEnabled;

Loading…
Cancel
Save