计时器转换必须严格符合选项

时间:2019-05-13 14:12:34

标签: vb.net event-handling option-strict

我正在尝试将其他人的VB代码转换为严格符合选项的要求。这是代码:

Dim WaitForAuthTimer As New System.Timers.Timer(1000)
Dim RefreshMessagesTimer As New System.Timers.Timer(10000)
Dim RefreshStatusesTimer As New System.Timers.Timer(300000)
Dim SyncUITimer As New System.Timers.Timer(1000)

然后在子目录中

AddHandler WaitForAuthTimer.Elapsed, AddressOf WaitForAuth
AddHandler RefreshMessagesTimer.Elapsed, AddressOf GetMessagesAsTask
AddHandler RefreshStatusesTimer.Elapsed, AddressOf GetStatuses
AddHandler SyncUITimer.Elapsed, AddressOf RefreshMessages

错误是:

  

错误BC36663
  Option Strict On不允许缩小方法'Public Sub WaitForAuth()'和委托'Delegate Sub ElapsedEventHandler(sender as Object,e As ElapsedEventArgs)'之间的隐式类型转换

0 个答案:

没有答案