From c66423fb9fb4d6b3e6408d69dc8ef937b4bbf56c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 10 Sep 2019 02:43:00 +0200 Subject: [PATCH] Add static overlay icon. --- ILSpy/ILSpy.csproj | 10 ++++++++++ ILSpy/Images/Images.cs | 4 ---- ILSpy/Images/OverlayStatic.png | Bin 347 -> 144 bytes ILSpy/Images/OverlayStatic.xaml | 9 +++++++++ ILSpy/Images/TypeIcon.cs | 3 +-- ILSpy/TreeNodes/TypeTreeNode.cs | 8 ++++---- 6 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 ILSpy/Images/OverlayStatic.xaml diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 319e94081..a7d106eed 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -322,6 +322,8 @@ + + @@ -450,6 +452,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/ILSpy/Images/Images.cs b/ILSpy/Images/Images.cs index 70c3928b9..f4d089535 100644 --- a/ILSpy/Images/Images.cs +++ b/ILSpy/Images/Images.cs @@ -215,7 +215,6 @@ namespace ICSharpCode.ILSpy PreloadPublicIconToCache(TypeIcon.Struct, Images.Struct); PreloadPublicIconToCache(TypeIcon.Interface, Images.Interface); PreloadPublicIconToCache(TypeIcon.Delegate, Images.Delegate); - PreloadPublicIconToCache(TypeIcon.StaticClass, Images.StaticClass); } protected override object GetBaseImage(TypeIcon icon) @@ -237,9 +236,6 @@ namespace ICSharpCode.ILSpy case TypeIcon.Delegate: baseImage = Images.Delegate; break; - case TypeIcon.StaticClass: - baseImage = Images.StaticClass; - break; default: throw new ArgumentOutOfRangeException(nameof(icon), $"TypeIcon.{icon} is not supported!"); } diff --git a/ILSpy/Images/OverlayStatic.png b/ILSpy/Images/OverlayStatic.png index 1a0e5e9d44f576b710ac23ea83820b3b25972871..e6a140ff3235e49b1e0f61fc8ae1e35ec943a9c1 100644 GIT binary patch delta 115 zcmcc3G=Xt~N)Bg%M`SSr1K(i~W;~w1B87p0!O7FbF{C2y?L`Mm8_3_(j(p-S)r zrl18i)}2Rh7oGn1zy8Ai|1LZK{g*4$ z-}ju!ZAvOs1p(kbwMeUE+Xa|r@fmkNa;I%L#OyRF0IGrjaGasc7rCH{KXuIoww&$H z*%DSBW(u8`#5rI-K^&@r2w>N#%3#wS!C={*#$eMKz+hT00hJjAqksTlU;qFf-c;gX SbfU)q0000 + + + + + + + + \ No newline at end of file diff --git a/ILSpy/Images/TypeIcon.cs b/ILSpy/Images/TypeIcon.cs index a3e6b4b91..ec4b8fd58 100644 --- a/ILSpy/Images/TypeIcon.cs +++ b/ILSpy/Images/TypeIcon.cs @@ -25,7 +25,6 @@ namespace ICSharpCode.ILSpy Enum, Struct, Interface, - Delegate, - StaticClass + Delegate } } diff --git a/ILSpy/TreeNodes/TypeTreeNode.cs b/ILSpy/TreeNodes/TypeTreeNode.cs index 8772874fe..cb40b06b2 100644 --- a/ILSpy/TreeNodes/TypeTreeNode.cs +++ b/ILSpy/TreeNodes/TypeTreeNode.cs @@ -112,11 +112,12 @@ namespace ICSharpCode.ILSpy.TreeNodes public static object GetIcon(ITypeDefinition type) { - return Images.GetIcon(GetTypeIcon(type), GetOverlayIcon(type)); + return Images.GetIcon(GetTypeIcon(type, out bool isStatic), GetOverlayIcon(type), isStatic); } - internal static TypeIcon GetTypeIcon(IType type) + internal static TypeIcon GetTypeIcon(IType type, out bool isStatic) { + isStatic = false; switch (type.Kind) { case TypeKind.Interface: return TypeIcon.Interface; @@ -127,8 +128,7 @@ namespace ICSharpCode.ILSpy.TreeNodes case TypeKind.Enum: return TypeIcon.Enum; default: - if (type.GetDefinition()?.IsStatic == true) - return TypeIcon.StaticClass; + isStatic = type.GetDefinition()?.IsStatic == true; return TypeIcon.Class; } }