ControllerDescriptor.GetCustomAttributes 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
GetCustomAttributes(Boolean) |
检索为此成员定义的自定义特性,指定的特性除外。 |
GetCustomAttributes(Type, Boolean) |
检索为此成员定义的指定类型的自定义特性(指定的特性除外)。 |
GetCustomAttributes(Boolean)
检索为此成员定义的自定义特性,指定的特性除外。
public virtual object[] GetCustomAttributes (bool inherit);
abstract member GetCustomAttributes : bool -> obj[]
override this.GetCustomAttributes : bool -> obj[]
Public Overridable Function GetCustomAttributes (inherit As Boolean) As Object()
参数
- inherit
- Boolean
如果为 true,则查找继承的自定义属性的层次结构链;否则为 false。
返回
Object[]
自定义特性的数组,如果没有自定义特性,则为空数组。
实现
例外
无法加载自定义特性类型。
为此成员定义了多个类型的 attributeType
属性。
适用于
GetCustomAttributes(Type, Boolean)
检索为此成员定义的指定类型的自定义特性(指定的特性除外)。
public virtual object[] GetCustomAttributes (Type attributeType, bool inherit);
abstract member GetCustomAttributes : Type * bool -> obj[]
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overridable Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()
参数
- attributeType
- Type
自定义属性的类型。
- inherit
- Boolean
如果为 true,则查找继承的自定义属性的层次结构链;否则为 false。
返回
Object[]
自定义特性的数组,如果没有自定义特性,则为空数组。
实现
例外
无法加载自定义特性类型。
为此成员定义了多个类型的 attributeType
属性。
参数 attributeType
为 null (Visual Basic) 中为 Nothing。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈