EventInfo.GetRaiseMethod 方法

定义

返回引发事件时所调用的方法。Returns the method that is called when the event is raised.

重载

GetRaiseMethod()

返回引发事件时所调用的方法。Returns the method that is called when the event is raised.

GetRaiseMethod(Boolean)

在派生类中重写时,返回引发事件时调用的方法,指定是否返回非公共方法。When overridden in a derived class, returns the method that is called when the event is raised, specifying whether to return non-public methods.

GetRaiseMethod()

返回引发事件时所调用的方法。Returns the method that is called when the event is raised.

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

返回

MethodInfo

引发事件时所调用的方法。The method that is called when the event is raised.

实现

注解

null对于用 c # event 关键字或 Visual Basic 关键字声明的事件,此方法通常返回 EventThis method usually returns null for events declared with the C# event keyword or the Visual Basic Event keyword. 这是因为在默认情况下,c # 和 Visual Basic 编译器不会生成此类方法。This is because the C# and Visual Basic compilers do not generate such a method by default.

另请参阅

适用于

GetRaiseMethod(Boolean)

在派生类中重写时,返回引发事件时调用的方法,指定是否返回非公共方法。When overridden in a derived class, returns the method that is called when the event is raised, specifying whether to return non-public methods.

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;否则为 falsetrue if non-public methods can be returned; otherwise, false.

返回

MethodInfo

引发事件时调用的 MethodInfo 对象。A MethodInfo object that was called when the event was raised.

实现

例外

nonPublictrue,用于添加事件处理程序委托的方法为非公共方法,且调用方没有权限反映非公共方法。nonPublic is true, the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods.

注解

null对于用 c # event 关键字或 Visual Basic 关键字声明的事件,此方法通常返回 EventThis method usually returns null for events declared with the C# event keyword or the Visual Basic Event keyword. 这是因为在默认情况下,c # 和 Visual Basic 编译器不会生成此类方法。This is because the C# and Visual Basic compilers do not generate such a method by default.

另请参阅

适用于