Share via


ModelAttributes 类

定义

提供对与 Type、 属性或参数关联的属性组合列表的访问。

public ref class ModelAttributes
public class ModelAttributes
type ModelAttributes = class
Public Class ModelAttributes
继承
ModelAttributes

构造函数

ModelAttributes(IEnumerable<Object>)
已过时.

ModelAttributesType创建新的 。

ModelAttributes(IEnumerable<Object>, IEnumerable<Object>)
已过时.

为属性新建 ModelAttributes 一个 。

属性

Attributes

获取所有属性的集。 如果此实例表示属性的属性,则属性定义中的属性位于 属性的 Type上的属性之前。 如果此实例表示参数的属性,则参数定义中的属性位于参数 的 Type上的属性之前。

ParameterAttributes

如果此实例不表示参数的属性, null 则获取参数的属性集。

PropertyAttributes

获取属性上的属性集,如果 null 此实例不表示属性的属性,则获取 。

TypeAttributes

获取 上的 Type属性集。 如果此实例表示属性,则 TypeAttributes 包含从 PropertyType检索到的属性。 如果此实例表示参数,则包含从 ParameterType检索到的属性。

方法

GetAttributesForParameter(ParameterInfo)

获取给定 parameterInfo的属性。

GetAttributesForParameter(ParameterInfo, Type)

使用指定的 modelType获取给定 parameterInfo 的属性。

GetAttributesForProperty(Type, PropertyInfo)

获取给定 property的属性。

GetAttributesForProperty(Type, PropertyInfo, Type)

使用指定的 modelType获取给定 property 的属性。

GetAttributesForType(Type)

获取给定 type的属性。

适用于