EventInfo.GetRaiseMethod 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回引发事件时调用的方法。
重载
| 名称 | 说明 |
|---|---|
| GetRaiseMethod() |
返回引发事件时调用的方法。 |
| GetRaiseMethod(Boolean) |
在派生类中重写时,返回在引发事件时调用的方法,指定是否返回非公共方法。 |
GetRaiseMethod()
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
返回引发事件时调用的方法。
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# null 关键字或 Visual Basic event 关键字声明的事件返回 Event。 这是因为 C# 和 Visual Basic 编译器默认情况下不会生成此类方法。
另请参阅
适用于
GetRaiseMethod(Boolean)
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
- Source:
- EventInfo.cs
在派生类中重写时,返回在引发事件时调用的方法,指定是否返回非公共方法。
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 事件时调用的对象。
实现
例外
nonPublic 是 true,用于添加事件处理程序委托的方法是非公共的,并且调用方无权反映非公共方法。
注解
此方法通常为使用 C# null 关键字或 Visual Basic event 关键字声明的事件返回 Event。 这是因为 C# 和 Visual Basic 编译器默认情况下不会生成此类方法。