From 006c6cb4eb6a2d677e479bc092d0a4f235aa4dc3 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 20 Sep 2019 14:04:55 +0200 Subject: [PATCH] Fix icons in SearchPane. --- ILSpy/Controls/SearchBoxStyle.xaml | 4 ++-- ILSpy/Search/AbstractSearchStrategy.cs | 2 +- ILSpy/Search/SearchPane.cs | 8 ++++---- ILSpy/TreeNodes/EventTreeNode.cs | 2 +- ILSpy/TreeNodes/FieldTreeNode.cs | 2 +- ILSpy/TreeNodes/MethodTreeNode.cs | 2 +- ILSpy/TreeNodes/PropertyTreeNode.cs | 2 +- ILSpy/TreeNodes/TypeTreeNode.cs | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ILSpy/Controls/SearchBoxStyle.xaml b/ILSpy/Controls/SearchBoxStyle.xaml index 80224dc9e..67c78eb99 100644 --- a/ILSpy/Controls/SearchBoxStyle.xaml +++ b/ILSpy/Controls/SearchBoxStyle.xaml @@ -43,7 +43,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" ToolTip="Search" - Source="pack://application:,,,/ILSpy;component/images/search.png" /> + Source="{local:XamlResource Images/Search}" /> @@ -57,7 +57,7 @@ + Value="{local:XamlResource Images/Close}" /> diff --git a/ILSpy/Search/AbstractSearchStrategy.cs b/ILSpy/Search/AbstractSearchStrategy.cs index 3ac17a179..bf6f8e47e 100644 --- a/ILSpy/Search/AbstractSearchStrategy.cs +++ b/ILSpy/Search/AbstractSearchStrategy.cs @@ -202,7 +202,7 @@ namespace ICSharpCode.ILSpy.Search } } - internal static object GetIcon(IEntity member) + internal static ImageSource GetIcon(IEntity member) { switch (member) { case ITypeDefinition t: diff --git a/ILSpy/Search/SearchPane.cs b/ILSpy/Search/SearchPane.cs index 44f7f8a77..bfe14bc35 100644 --- a/ILSpy/Search/SearchPane.cs +++ b/ILSpy/Search/SearchPane.cs @@ -373,8 +373,8 @@ namespace ICSharpCode.ILSpy public sealed class SearchResult : IMemberTreeNode { - object image; - object locationImage; + ImageSource image; + ImageSource locationImage; public static readonly IComparer Comparer = new SearchResultComparer(); @@ -385,7 +385,7 @@ namespace ICSharpCode.ILSpy public string Name { get; set; } public object ToolTip { get; set; } - public object Image { + public ImageSource Image { get { if (image == null) { image = AbstractSearchStrategy.GetIcon(Member); @@ -394,7 +394,7 @@ namespace ICSharpCode.ILSpy } } - public object LocationImage { + public ImageSource LocationImage { get { if (locationImage == null) { locationImage = Member.DeclaringTypeDefinition != null ? TypeTreeNode.GetIcon(Member.DeclaringTypeDefinition) : Images.Namespace; diff --git a/ILSpy/TreeNodes/EventTreeNode.cs b/ILSpy/TreeNodes/EventTreeNode.cs index c76c02526..1aadff896 100644 --- a/ILSpy/TreeNodes/EventTreeNode.cs +++ b/ILSpy/TreeNodes/EventTreeNode.cs @@ -52,7 +52,7 @@ namespace ICSharpCode.ILSpy.TreeNodes public override object Icon => GetIcon(EventDefinition); - public static object GetIcon(IEvent @event) + public static ImageSource GetIcon(IEvent @event) { return Images.GetIcon(MemberIcon.Event, MethodTreeNode.GetOverlayIcon(@event.Accessibility), @event.IsStatic); } diff --git a/ILSpy/TreeNodes/FieldTreeNode.cs b/ILSpy/TreeNodes/FieldTreeNode.cs index 6e7aab4b5..5d4d2f7b0 100644 --- a/ILSpy/TreeNodes/FieldTreeNode.cs +++ b/ILSpy/TreeNodes/FieldTreeNode.cs @@ -44,7 +44,7 @@ namespace ICSharpCode.ILSpy.TreeNodes public override object Icon => GetIcon(FieldDefinition); - public static object GetIcon(IField field) + public static ImageSource GetIcon(IField field) { if (field.DeclaringType.Kind == TypeKind.Enum && field.ReturnType.Kind == TypeKind.Enum) return Images.GetIcon(MemberIcon.EnumValue, MethodTreeNode.GetOverlayIcon(field.Accessibility), false); diff --git a/ILSpy/TreeNodes/MethodTreeNode.cs b/ILSpy/TreeNodes/MethodTreeNode.cs index 84b6f0018..9e4d95e45 100644 --- a/ILSpy/TreeNodes/MethodTreeNode.cs +++ b/ILSpy/TreeNodes/MethodTreeNode.cs @@ -45,7 +45,7 @@ namespace ICSharpCode.ILSpy.TreeNodes public override object Icon => GetIcon(MethodDefinition); - public static object GetIcon(IMethod method) + public static ImageSource GetIcon(IMethod method) { if (method.IsOperator) return Images.GetIcon(MemberIcon.Operator, GetOverlayIcon(method.Accessibility), false); diff --git a/ILSpy/TreeNodes/PropertyTreeNode.cs b/ILSpy/TreeNodes/PropertyTreeNode.cs index 0396a0ee9..14769ea66 100644 --- a/ILSpy/TreeNodes/PropertyTreeNode.cs +++ b/ILSpy/TreeNodes/PropertyTreeNode.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.ILSpy.TreeNodes public override object Icon => GetIcon(PropertyDefinition); - public static object GetIcon(IProperty property) + public static ImageSource GetIcon(IProperty property) { return Images.GetIcon(property.IsIndexer ? MemberIcon.Indexer : MemberIcon.Property, MethodTreeNode.GetOverlayIcon(property.Accessibility), property.IsStatic); diff --git a/ILSpy/TreeNodes/TypeTreeNode.cs b/ILSpy/TreeNodes/TypeTreeNode.cs index cb40b06b2..750c5bc61 100644 --- a/ILSpy/TreeNodes/TypeTreeNode.cs +++ b/ILSpy/TreeNodes/TypeTreeNode.cs @@ -110,7 +110,7 @@ namespace ICSharpCode.ILSpy.TreeNodes public override object Icon => GetIcon(TypeDefinition); - public static object GetIcon(ITypeDefinition type) + public static ImageSource GetIcon(ITypeDefinition type) { return Images.GetIcon(GetTypeIcon(type, out bool isStatic), GetOverlayIcon(type), isStatic); }