_PropertyInfo.GetSetMethod 方法

定義

為 COM 物件提供與版本無關的 GetSetMethod 方法之存取權。

多載

GetSetMethod(Boolean)

為 COM 物件提供與版本無關的 GetSetMethod(Boolean) 方法之存取權。

GetSetMethod()

為 COM 物件提供與版本無關的 GetSetMethod() 方法之存取權。

備註

這個方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法會 GetSetMethod 傳回 MethodInfo 物件,表示這個屬性的 set 存取子。

GetSetMethod(Boolean)

為 COM 物件提供與版本無關的 GetSetMethod(Boolean) 方法之存取權。

public:
 System::Reflection::MethodInfo ^ GetSetMethod(bool nonPublic);
public System.Reflection.MethodInfo GetSetMethod (bool nonPublic);
abstract member GetSetMethod : bool -> System.Reflection.MethodInfo
Public Function GetSetMethod (nonPublic As Boolean) As MethodInfo

參數

nonPublic
Boolean

true 表示要傳回非公用的存取子,否則為 false

傳回

下表的其中一個值。

意義
MethodInfo 物件,表示這個屬性的 Set 方法。 set 存取子為公用,或 nonPublic 參數為 trueset 存取子為非公用。
null nonPublic 參數為 true,但屬性為唯讀,或 nonPublic 參數為 falseset 存取子為非公用,或沒有 set 存取子。

備註

這個方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法 GetSetMethod 會傳回這個屬性的 set 存取子。

適用於

GetSetMethod()

為 COM 物件提供與版本無關的 GetSetMethod() 方法之存取權。

public:
 System::Reflection::MethodInfo ^ GetSetMethod();
public System.Reflection.MethodInfo GetSetMethod ();
abstract member GetSetMethod : unit -> System.Reflection.MethodInfo
Public Function GetSetMethod () As MethodInfo

傳回

MethodInfo 物件,代表這個屬性的 Set 方法 (如果 set 存取子是公用的),或 null (如果 set 存取子不是公用的)。

備註

這個方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法 GetSetMethod 會傳回這個屬性的公用 set 存取子。

適用於