RuntimeReflectionExtensions.GetRuntimeProperty(Type, String) 方法

定義

擷取表示指定之屬性的物件。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

包含屬性的型別。The type that contains the property.

name
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.

適用於

另請參閱