mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
FieldTreeNode used the base Field icon for every kind of field. The WPF version distinguished EnumValue and Literal so a reader could tell at a glance whether a member was a backing field, a const, or an enum case. Mirror the master logic (master:ILSpy/TreeNodes/FieldTreeNode.cs:60), but with two scope cuts: - Use Images.Enum for enum values. We don't have a dedicated EnumValue.svg, and the type-level Enum glyph reads correctly in context (an enum case sits inside an Enum node). - Skip the FieldReadOnly branch entirely -- no asset exists yet and inventing one isn't in scope for this commit. Readonly fields keep falling through to the base Field icon, the same as before. Detection rule for an enum value: DeclaringType.Kind is Enum AND ReturnType.Kind is Enum. The second clause is what excludes the synthesised int32 value__ backing field that every enum carries -- that field's return type is Int32, not the enum itself. Assisted-by: Claude:claude-opus-4-7:Claude Codepull/3755/head
1 changed files with 21 additions and 2 deletions
Loading…
Reference in new issue