diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 526be03db..fb0484079 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -236,6 +236,7 @@ + @@ -303,6 +304,5 @@ ICSharpCode.TreeView - \ No newline at end of file diff --git a/ILSpy/Images/Images.cs b/ILSpy/Images/Images.cs index 361f6a5a8..8755e772e 100644 --- a/ILSpy/Images/Images.cs +++ b/ILSpy/Images/Images.cs @@ -65,6 +65,7 @@ namespace ICSharpCode.ILSpy public static readonly BitmapImage Interface = LoadBitmap("Interface"); public static readonly BitmapImage Delegate = LoadBitmap("Delegate"); public static readonly BitmapImage Enum = LoadBitmap("Enum"); + public static readonly BitmapImage StaticClass = LoadBitmap("StaticClass"); public static readonly BitmapImage Field = LoadBitmap("Field"); @@ -133,6 +134,7 @@ 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 ImageSource GetBaseImage(TypeIcon icon) @@ -154,6 +156,9 @@ namespace ICSharpCode.ILSpy case TypeIcon.Delegate: baseImage = Images.Delegate; break; + case TypeIcon.StaticClass: + baseImage = Images.StaticClass; + break; default: throw new NotSupportedException(); } diff --git a/ILSpy/Images/StaticClass.png b/ILSpy/Images/StaticClass.png new file mode 100644 index 000000000..af9ebd06a Binary files /dev/null and b/ILSpy/Images/StaticClass.png differ diff --git a/ILSpy/Images/TypeIcon.cs b/ILSpy/Images/TypeIcon.cs index 2e5f3f498..7bbb0d08a 100644 --- a/ILSpy/Images/TypeIcon.cs +++ b/ILSpy/Images/TypeIcon.cs @@ -26,6 +26,7 @@ namespace ICSharpCode.ILSpy Enum, Struct, Interface, - Delegate + Delegate, + StaticClass } } diff --git a/ILSpy/TreeNodes/TypeTreeNode.cs b/ILSpy/TreeNodes/TypeTreeNode.cs index 23bce5df7..c62e53e9f 100644 --- a/ILSpy/TreeNodes/TypeTreeNode.cs +++ b/ILSpy/TreeNodes/TypeTreeNode.cs @@ -146,8 +146,10 @@ namespace ICSharpCode.ILSpy.TreeNodes } else { if (type.IsInterface) return TypeIcon.Interface; - else if (type.BaseType != null && type.BaseType.FullName == typeof(MulticastDelegate).FullName) + else if (IsDelegate(type)) return TypeIcon.Delegate; + else if (IsStaticClass(type)) + return TypeIcon.StaticClass; else return TypeIcon.Class; } @@ -178,6 +180,20 @@ namespace ICSharpCode.ILSpy.TreeNodes } return overlay; } + + private static bool IsDelegate(TypeDefinition type) + { + return type.BaseType != null && type.BaseType.FullName == typeof(MulticastDelegate).FullName; + } + + private static bool IsStaticClass(TypeDefinition type) + { + if(type.IsSealed) + return !type.Methods.Where(m => m.Name == ".ctor").Any(m => !m.IsPrivate); + + return false; + } + #endregion MemberReference IMemberTreeNode.Member {