TimerElapsedEventHandler 委托

定义

表示用来处理 TimerElapsed 事件的方法。Represents the method that will handle the TimerElapsed event.

public delegate void TimerElapsedEventHandler(System::Object ^ sender, TimerElapsedEventArgs ^ e);
public delegate void TimerElapsedEventHandler(object sender, TimerElapsedEventArgs e);
type TimerElapsedEventHandler = delegate of obj * TimerElapsedEventArgs -> unit
Public Delegate Sub TimerElapsedEventHandler(sender As Object, e As TimerElapsedEventArgs)

参数

sender
Object

事件源。The source of the event. SystemEvents 类引发此事件时,此对象总是为 nullWhen this event is raised by the SystemEvents class, this object is always null.

e
TimerElapsedEventArgs

包含事件数据的 TimerElapsedEventArgsA TimerElapsedEventArgs that contains the event data.

继承
TimerElapsedEventHandler

注解

创建 TimerElapsedEventHandler 委托时,需要标识将处理该事件的方法。When you create a TimerElapsedEventHandler delegate, you identify the method that will handle the event. 若要将事件与事件处理方法关联, 请将委托的实例添加到事件。To associate the event with your event-handling method, add an instance of the delegate to the event. 只要事件发生, 就会调用事件处理方法, 除非删除委托。The event-handling method is called whenever the event occurs, unless you remove the delegate. 有关事件处理程序委托的详细信息, 请参阅处理和引发事件For more information about event-handler delegates, see Handling and Raising Events.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅