I am trying to convert C# code into VB code and getting confused with delegates. Delegates are objects that can call methods of other objects.
The lines with the += are the lines I cannot figure out how to convert.
What I have tried are different combinations of AddressOf and AddHandler.
Each time a blue line with a mouse over stating it is not an Event or the delegates are not of the same type. To compound the issue I do not know enough about delegates and events.
Private _preClean As TestCleanup
Delegate Sub TestCleanup()
Private _preTestCleanup As TestRunner.TestCleanup
Public ReadOnly Property PreTestCleanup() As TestRunner.TestCleanup
Get
Return _preTestCleanup
End Get
End Property
...
End Structure
Public Sub AddTestGroup(ByVal tg As TestGroup)
_preClean += tg.PreTestCleanup
_testCaseDel += tg.TestRun
_postClean += tg.PostTestCleanup
_testValidity += tg.TestValidityCheck
End Sub 'AddTestGroup
Any help appreciated,
Marty
The lines with the += are the lines I cannot figure out how to convert.
What I have tried are different combinations of AddressOf and AddHandler.
Each time a blue line with a mouse over stating it is not an Event or the delegates are not of the same type. To compound the issue I do not know enough about delegates and events.
Private _preClean As TestCleanup
Delegate Sub TestCleanup()
Private _preTestCleanup As TestRunner.TestCleanup
Public ReadOnly Property PreTestCleanup() As TestRunner.TestCleanup
Get
Return _preTestCleanup
End Get
End Property
...
End Structure
Public Sub AddTestGroup(ByVal tg As TestGroup)
_preClean += tg.PreTestCleanup
_testCaseDel += tg.TestRun
_postClean += tg.PostTestCleanup
_testValidity += tg.TestValidityCheck
End Sub 'AddTestGroup
Any help appreciated,
Marty