_PropertyInfo.GetSetMethod 方法
定义
为 COM 对象提供对 GetSetMethod 方法的与版本无关的访问。Provides COM objects with version-independent access to the GetSetMethod methods.
重载
| GetSetMethod(Boolean) |
为 COM 对象提供对 GetSetMethod(Boolean) 方法的与版本无关的访问。Provides COM objects with version-independent access to the GetSetMethod(Boolean) method. |
| GetSetMethod() |
为 COM 对象提供对 GetSetMethod() 方法的与版本无关的访问。Provides COM objects with version-independent access to the GetSetMethod() method. |
注解
此方法用于从非托管代码访问托管类,不应从托管代码调用。This method is for access to managed classes from unmanaged code and should not be called from managed code.
GetSetMethod方法返回一个对象,该 MethodInfo 对象表示 set 此属性的访问器。The GetSetMethod methods return a MethodInfo object representing the set accessor for this property.
GetSetMethod(Boolean)
为 COM 对象提供对 GetSetMethod(Boolean) 方法的与版本无关的访问。Provides COM objects with version-independent access to the GetSetMethod(Boolean) method.
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。true to return a non-public accessor; otherwise, false.
返回
下表中的值之一。One of the values in the following table.
| “值”Value | 含义Meaning |
|---|---|
表示此属性的 MethodInfo 方法的 Set 对象。A MethodInfo object representing the Set method for this property.
| set 访问器是公共的。或者,nonPublic 参数为 true 且 set 访问器是非公共的。The set accessor is public, OR the nonPublic parameter is true and the set accessor is non-public.
|
null | nonPublic 参数为 true,但属性为只读。或者,nonPublic 参数为 false 且 set 访问器是非公共的。或者,没有 set 访问器。The nonPublic parameter is true, but the property is read-only, OR the nonPublic parameter is false and the set accessor is non-public, OR there is no set accessor. |
注解
此方法用于从非托管代码访问托管类,不应从托管代码调用。This method is for access to managed classes from unmanaged code and should not be called from managed code.
GetSetMethod方法返回 set 此属性的访问器。The GetSetMethod method returns the set accessor for this property.
适用于
GetSetMethod()
为 COM 对象提供对 GetSetMethod() 方法的与版本无关的访问。Provides COM objects with version-independent access to the GetSetMethod() method.
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。The MethodInfo object representing the Set method for this property if the set accessor is public, or null if the set accessor is not public.
注解
此方法用于从非托管代码访问托管类,不应从托管代码调用。This method is for access to managed classes from unmanaged code and should not be called from managed code.
GetSetMethod方法返回 set 此属性的公共访问器。The GetSetMethod method returns the public set accessor for this property.