AccessibleObject.IReflect.GetProperty Method

Definition

Overloads

IReflect.GetProperty(String, BindingFlags)

在指定的搜索约束下获取与指定属性对应的 PropertyInfo 对象。Gets a PropertyInfo object corresponding to a specified property under specified search constraints. 有关此成员的说明,请参见 GetProperty(String, BindingFlags)For a description of this member, see GetProperty(String, BindingFlags).

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

在指定的搜索约束下获取与指定属性对应的 PropertyInfo 对象。Gets a PropertyInfo object corresponding to a specified property with specified search constraints. 有关此成员的说明,请参见 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])For a description of this member, see GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]).

IReflect.GetProperty(String, BindingFlags)

在指定的搜索约束下获取与指定属性对应的 PropertyInfo 对象。Gets a PropertyInfo object corresponding to a specified property under specified search constraints. 有关此成员的说明,请参见 GetProperty(String, BindingFlags)For a description of this member, see GetProperty(String, BindingFlags).

 virtual System::Reflection::PropertyInfo ^ System.Reflection.IReflect.GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr) = System::Reflection::IReflect::GetProperty;
System.Reflection.PropertyInfo IReflect.GetProperty (string name, System.Reflection.BindingFlags bindingAttr);
abstract member System.Reflection.IReflect.GetProperty : string * System.Reflection.BindingFlags -> System.Reflection.PropertyInfo
override this.System.Reflection.IReflect.GetProperty : string * System.Reflection.BindingFlags -> System.Reflection.PropertyInfo
Function GetProperty (name As String, bindingAttr As BindingFlags) As PropertyInfo Implements IReflect.GetProperty

Parameters

name
String

要查找的属性名称。The name of the property to find.

bindingAttr
BindingFlags

用于控制搜索的绑定属性。The binding attributes used to control the search.

Returns

PropertyInfo

找到的与 bindingAttr 中指定的搜索约束相符的属性的 PropertyInfo 对象;如果没有找到此属性,则为 nullA PropertyInfo object for the located property that meets the search constraints specified in bindingAttr, or null if the property was not located.

Implements

Exceptions

该对象实现同名的多个方法。The object implements multiple methods with the same name.

Remarks

此成员是显式接口成员实现。This member is an explicit interface member implementation. 它只能在 AccessibleObject 实例被强制转换为 IReflect 接口时使用。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

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

在指定的搜索约束下获取与指定属性对应的 PropertyInfo 对象。Gets a PropertyInfo object corresponding to a specified property with specified search constraints. 有关此成员的说明,请参见 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])For a description of this member, see GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]).

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

Parameters

name
String

要查找的成员的名称。The name of the member to find.

bindingAttr
BindingFlags

用于控制搜索的绑定属性。The binding attributes used to control the search.

binder
Binder

实现 Binder 的对象,它包含与此方法相关的属性。An object that implements Binder, containing properties related to this method.

returnType
Type

用于从重载方法中进行选择的数组。An array used to choose among overloaded methods.

types
Type[]

参数修饰符的数组,用于使绑定可与在其中修改了类型的参数签名一起使用。An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.

modifiers
ParameterModifier[]

用于选择参数修饰符的数组。An array used to choose the parameter modifiers.

Returns

PropertyInfo

如果在此反射对象中找到了具有指定名称的属性,则为所找到的属性的 PropertyInfo 对象;如果没有找到此属性,则为 nullA PropertyInfo object for the located property, if a property with the specified name was located in this reflection object, or null if the property was not located.

Implements

Remarks

此成员是显式接口成员实现。This member is an explicit interface member implementation. 它只能在 AccessibleObject 实例被强制转换为 IReflect 接口时使用。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

Applies to