RuntimeReflectionExtensions.GetRuntimeProperty(Type, String) 方法

定義

擷取表示指定之屬性的物件。

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);
public static System.Reflection.PropertyInfo? GetRuntimeProperty (this Type type, string name);
static member GetRuntimeProperty : Type * string -> System.Reflection.PropertyInfo
<Extension()>
Public Function GetRuntimeProperty (type As Type, name As String) As PropertyInfo

參數

type
Type

包含屬性的型別。

name
String

屬性的名稱。

傳回

物件,表示指定的屬性,如果找不到屬性,則為 null

例外狀況

typenull

-或-

namenull

type 不是 RuntimeType

發現多個具有所要求名稱的屬性。

適用於

另請參閱