EventInfo.GetRaiseMethod 方法

定义

返回引发事件时所调用的方法。

重载

GetRaiseMethod()

返回引发事件时所调用的方法。

GetRaiseMethod(Boolean)

在派生类中重写时,返回引发事件时调用的方法,指定是否返回非公共方法。

GetRaiseMethod()

返回引发事件时所调用的方法。

public:
 System::Reflection::MethodInfo ^ GetRaiseMethod();
public:
 virtual System::Reflection::MethodInfo ^ GetRaiseMethod();
public System.Reflection.MethodInfo? GetRaiseMethod ();
public System.Reflection.MethodInfo GetRaiseMethod ();
member this.GetRaiseMethod : unit -> System.Reflection.MethodInfo
abstract member GetRaiseMethod : unit -> System.Reflection.MethodInfo
override this.GetRaiseMethod : unit -> System.Reflection.MethodInfo
Public Function GetRaiseMethod () As MethodInfo

返回

引发事件时所调用的方法。

实现

注解

此方法通常为使用 C# event 关键字或 Visual Basic Event 关键字声明的事件返回 null 。 这是因为默认情况下,C# 和 Visual Basic 编译器不会生成此类方法。

另请参阅

适用于

GetRaiseMethod(Boolean)

在派生类中重写时,返回引发事件时调用的方法,指定是否返回非公共方法。

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

参数

nonPublic
Boolean

如果可以返回非公共方法,则为 true;否则为 false

返回

引发事件时调用的 MethodInfo 对象。

实现

例外

nonPublictrue,用于添加事件处理程序委托的方法为非公共方法,且调用方没有权限反映非公共方法。

注解

此方法通常为使用 C# event 关键字或 Visual Basic Event 关键字声明的事件返回 null 。 这是因为默认情况下,C# 和 Visual Basic 编译器不会生成此类方法。

另请参阅

适用于