I have a class (in VB) that returns an event of TimeOut
, that is, if the time it pops up it returns an event with a string containing the data I need using RaiseEvent. How can I handle this event in the main class which is in C #. I tried using delegate but I could not. Thank you.
Code:
Public Class Dados
Public Event _TrateTimeOut(ByVal dados As Dados)
Private Sub MonitoraTimeOut()
If TimeOut Is Nothing Then
TimeOut = New Timers.Timer
TimeOut.Interval = 10000
AddHandler TimeOut.Elapsed, AddressOf TrateTimeOut
TimeOut.Start()
Else
TimeOut.Stop()
TimeOut.Start()
End If
End Sub
Private Sub TrateTimeOut()
RaiseEvent _TrateTimeOut(Me)
End Sub
End Class