RuntimeReflectionExtensions.GetRuntimeProperty(Type, String) RuntimeReflectionExtensions.GetRuntimeProperty(Type, String) RuntimeReflectionExtensions.GetRuntimeProperty(Type, String) Method

定义

检索表示指定属性的对象。Retrieves an object that represents a specified property.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Reflection::PropertyInfo ^ GetRuntimeProperty(Type ^ type, System::String ^ name);
public static System.Reflection.PropertyInfo GetRuntimeProperty (this Type type, string name);
static member GetRuntimeProperty : Type * string -> System.Reflection.PropertyInfo

参数

type
Type Type Type

包含该属性的类型。The type that contains the property.

name
String String String

属性的名称。The name of the property.

返回

表示指定属性的对象,若未找到该属性则为 nullAn object that represents the specified property, or null if the property is not found.

异常

typenulltype is null.

- 或 --or-

namenullname is null.

type 不是 RuntimeTypetype is not a RuntimeType.

已找到名称所请求名称一致的多个属性。More than one property with the requested name was found.

适用于

另请参阅