Why is Attributes.IsDefined() missing overloads?

前端 未结 1 1327
礼貌的吻别
礼貌的吻别 2021-01-30 12:22

Inspired by an SO question. The Attribute class has several overloads for the IsDefined() method. Covered are attributes applied to Assembly, Module, MemberInfo, ParameterInfo.

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 12:53

    There's a System.Attribute.IsDefined(MemberInfo element, Type attributeType, bool inherit) and System.Type derives from System.Reflection.MemberInfo.

    An assembly, which is the top-level container of any .NET assembly has one or more modules. Each module then contains types and types can have members such as properties, methods or even other types (nested types). That's why System.Type derives from MemberInfo so that the object model allows for types to work as containers all things members, including other types.

    0 讨论(0)
提交回复
热议问题