MethodBase.GetParameters Method gets the parameters of the specified method or constructor.
Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Public Delegate Sub MyDelegate(ByVal i As Integer)
Public Class MainClass
Public Event ev As MyDelegate
Public Shared Sub Main()
Dim delegateType As Type = GetType(MainClass).GetEvent("ev").EventHandlerType
Dim invoke As MethodInfo = delegateType.GetMethod("Invoke")
Dim pars As ParameterInfo() = invoke.GetParameters()
Dim p As ParameterInfo
For Each p In pars
Console.WriteLine(p.ParameterType)
Next p
End Sub
End Class
Related examples in the same category