1
我試圖找到一種方法來確定定時器已過期事件的訂戶數量。從我的搜索,似乎我應該使用GetInvocationList()。然而,當我嘗試:獲取Timer.Elapsed事件的訂閱者列表
Private _schedulingTimer As Timers.Timer
Private Sub SomeMethod()
dim test = _schedulingTimer.Elapsed.GetInvocationList()
End Sub
我得到以下錯誤:
'Public Event Elapsed As ElapsedEventHandler' is an event and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
難道我做錯了什麼?是否有另一種方式來獲得我所追求的?