@ -64,6 +64,25 @@ namespace ILSpy.Metadata
@@ -64,6 +64,25 @@ namespace ILSpy.Metadata
panel . Children . Add ( group . Build ( ) ) ;
return panel ;
}
/// <summary>
/// Tooltip for a <see cref="TypeAttributes"/> column: one single-choice group per
/// mutually exclusive sub-range (visibility, layout, class semantics, string format,
/// custom format) plus a multiple-choice group for the remaining independent bits.
/// Shared by every table whose rows carry type attributes (TypeDef, ExportedType).
/// </summary>
public static FlagsTooltip ForTypeAttributes ( TypeAttributes attributes )
{
const TypeAttributes otherFlagsMask = ~ ( TypeAttributes . VisibilityMask | TypeAttributes . LayoutMask | TypeAttributes . ClassSemanticsMask | TypeAttributes . StringFormatMask | TypeAttributes . CustomFormatMask ) ;
return new FlagsTooltip {
FlagGroup . CreateSingleChoiceGroup ( typeof ( TypeAttributes ) , "Visibility: " , ( int ) TypeAttributes . VisibilityMask , ( int ) ( attributes & TypeAttributes . VisibilityMask ) , new Flag ( "NotPublic (0000)" , 0 , false ) , includeAny : false ) ,
FlagGroup . CreateSingleChoiceGroup ( typeof ( TypeAttributes ) , "Class layout: " , ( int ) TypeAttributes . LayoutMask , ( int ) ( attributes & TypeAttributes . LayoutMask ) , new Flag ( "AutoLayout (0000)" , 0 , false ) , includeAny : false ) ,
FlagGroup . CreateSingleChoiceGroup ( typeof ( TypeAttributes ) , "Class semantics: " , ( int ) TypeAttributes . ClassSemanticsMask , ( int ) ( attributes & TypeAttributes . ClassSemanticsMask ) , new Flag ( "Class (0000)" , 0 , false ) , includeAny : false ) ,
FlagGroup . CreateSingleChoiceGroup ( typeof ( TypeAttributes ) , "String format: " , ( int ) TypeAttributes . StringFormatMask , ( int ) ( attributes & TypeAttributes . StringFormatMask ) , new Flag ( "AnsiClass (0000)" , 0 , false ) , includeAny : false ) ,
FlagGroup . CreateSingleChoiceGroup ( typeof ( TypeAttributes ) , "Custom format: " , ( int ) TypeAttributes . CustomFormatMask , ( int ) ( attributes & TypeAttributes . CustomFormatMask ) , new Flag ( "Value0 (0000)" , 0 , false ) , includeAny : false ) ,
FlagGroup . CreateMultipleChoiceGroup ( typeof ( TypeAttributes ) , "Flags:" , ( int ) otherFlagsMask , ( int ) ( attributes & otherFlagsMask ) , includeAll : false ) ,
} ;
}
}
public readonly struct Flag