Delegate Test

 

Imports Microsoft.VisualBasic.CallType

Public Class TestJump
Inherits Test

Delegate Sub T()

Public Overrides Sub RunTest()

Try
'Call TestBack()
Dim st As New StackFrame
Me.Name = st.GetMethod.ReflectedType.Name
Dim op As T = AddressOf TestBack
op.Invoke()
Call TestDelegate(AddressOf TestMe.TestBack)
Me.Result = True

Catch ex As Exception
Me.Result = False
Me.FailMessage = ex.Message
End Try

End Sub

Private Sub TestDelegate(ByVal op As T)
op.Invoke()
End Sub

End Class

Module TestMe
Public Sub TestBack()
Debug.Print("Here123")
'Debug.Close()
End Sub
End Module

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: