I have a class that catches an event System.Diagnostics.DataReceivedEventArgs.
I want to make this event accessible from the outside. For this, I am currently breaking it internally and raising another event that seems a little duplicate to me.
What is the best way to do this? Can I connect these events, so I don’t need to raise a new event?
Here is the code:
Class MyClass
Public Event OutputDataReceived(sender As Object, e As System.Diagnostics.DataReceivedEventArgs)
Public Sub Action()
....
AddHandler Process.OutputDataReceived, AddressOf ReadData
....
End Sub
Private Sub ReadData(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs)
RaiseEvent Me.OutputDataReceived(sender, e)
End Sub
End Class
source
share