MethodBase.GetParameters Method gets the parameters of the specified method or constructor. : MethodBase « Reflection « VB.Net






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

1.MethodBase.IsAbstract Property gets a value indicating whether the method is abstract.
2.MethodBase.IsAssembly Property
3.MethodBase.IsFinal Property gets a value indicating whether this method is final.
4.MethodBase.IsPublic Property