_Type.GetProperty 方法

定义

为 COM 对象提供对 GetProperty 方法的与版本无关的访问。

重载

GetProperty(String, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, Type, Type[], ParameterModifier[]) 方法的与版本无关的访问。

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) 方法的与版本无关的访问。

GetProperty(String, Type, Type[])

为 COM 对象提供对 GetProperty(String, Type, Type[]) 方法的与版本无关的访问。

GetProperty(String, Type)

为 COM 对象提供对 GetProperty(String, Type) 方法的与版本无关的访问。

GetProperty(String, Type[])

为 COM 对象提供对 GetProperty(String, Type[]) 方法的与版本无关的访问。

GetProperty(String, BindingFlags)

为 COM 对象提供对 GetProperty(String, BindingFlags) 方法的与版本无关的访问。

GetProperty(String)

为 COM 对象提供对 GetProperty(String) 方法的与版本无关的访问。

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 获取当前 Type的特定属性。

GetProperty(String, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, Type, Type[], ParameterModifier[]) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo

参数

name
String

包含要获取的公共属性名的 String

returnType
Type

属性的返回类型。

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。

- 或 -

获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。

modifiers
ParameterModifier[]

ParameterModifier 对象的数组,表示与 types 数组中的相应元素关联的特性。 默认的联编程序不处理此参数。

返回

表示符合指定要求的公共属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 搜索其参数与指定参数类型和修饰符匹配的指定公共属性。

适用于

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

为 COM 对象提供对 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, bindingAttr As BindingFlags, binder As Binder, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo

参数

name
String

包含要获取的属性名的 String

bindingAttr
BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。

- 或 -

零,以返回 null

binder
Binder

一个 Binder 对象,该对象定义一组属性并启用绑定,而绑定可能涉及选择重载方法、强制转换参数类型和通过反射调用成员。

- 或 -

若为 null,则使用 DefaultBinder

returnType
Type

属性的返回类型。

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。

- 或 -

获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。

modifiers
ParameterModifier[]

ParameterModifier 对象的数组,表示与 types 数组中的相应元素关联的特性。 默认的联编程序不处理此参数。

返回

表示符合指定要求的属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 使用指定的绑定约束搜索其参数与指定参数类型和修饰符匹配的指定属性。

适用于

GetProperty(String, Type, Type[])

为 COM 对象提供对 GetProperty(String, Type, Type[]) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types);
abstract member GetProperty : string * Type * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type()) As PropertyInfo

参数

name
String

包含要获取的公共属性名的 String

returnType
Type

属性的返回类型。

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。

- 或 -

获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。

返回

表示其参数与指定参数类型匹配的公共属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 搜索其参数与指定参数类型匹配的指定公共属性。

适用于

GetProperty(String, Type)

为 COM 对象提供对 GetProperty(String, Type) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType);
abstract member GetProperty : string * Type -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type) As PropertyInfo

参数

name
String

包含要获取的公共属性名的 String

returnType
Type

属性的返回类型。

返回

表示具有指定名称的公共属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 搜索具有指定名称和返回类型的公共属性。

适用于

GetProperty(String, Type[])

为 COM 对象提供对 GetProperty(String, Type[]) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type[] types);
abstract member GetProperty : string * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, types As Type()) As PropertyInfo

参数

name
String

包含要获取的公共属性名的 String

types
Type[]

一个 Type 对象数组,表示要获取的索引属性的参数的数目、顺序和类型。

- 或 -

获取未被索引的属性的 Type 类型的空数组(即 Type[] types = new Type[0])。

返回

表示其参数与指定参数类型匹配的公共属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 搜索其参数与指定参数类型匹配的指定公共属性。

适用于

GetProperty(String, BindingFlags)

为 COM 对象提供对 GetProperty(String, BindingFlags) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetProperty : string * System.Reflection.BindingFlags -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, bindingAttr As BindingFlags) As PropertyInfo

参数

name
String

包含要获取的属性名的 String

bindingAttr
BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。

- 或 -

零,以返回 null

返回

表示符合指定要求的属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 使用指定的绑定约束搜索指定的属性。

适用于

GetProperty(String)

为 COM 对象提供对 GetProperty(String) 方法的与版本无关的访问。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name);
public System.Reflection.PropertyInfo GetProperty (string name);
abstract member GetProperty : string -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String) As PropertyInfo

参数

name
String

包含要获取的公共属性名的 String

返回

表示具有指定名称的公共属性的 PropertyInfo 对象(如果找到的话);否则为 null

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetProperty 搜索具有指定名称的公共属性。

适用于