Link to home
Start Free TrialLog in
Avatar of thenrich
thenrich

asked on

GetType

Hello experts,

I am trying to populate a combo with a list of public functions like this:

For Each o In m_RuleMgr.GetType.GetMethods()
            If Not o.IsHideBySig Then
                cmboPublic.Items.Add(o.name.toupper)
            End If
        Next

What I'd like to add to :
 cmboPublic.Items.Add(o.name.toupper)

are the argument names of the functions. How can I accomplish this?
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Seems like you've got it mostly figured out...what is the question?

Public Class Form1

    Private Class RuleMgr
        Public Function MethodA() As String
            Return ""
        End Function
        Public Function MethodB() As String
            Return ""
        End Function
        Public Function MethodC() As String
            Return ""
        End Function
    End Class

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim m_RuleMgr As New RuleMgr
        For Each o As System.Reflection.MethodInfo In m_RuleMgr.GetType.GetMethods()
            If Not o.IsHideBySig Then
                ComboBox1.Items.Add(o.Name.ToUpper)
            End If
        Next
    End Sub

End Class
Avatar of thenrich
thenrich

ASKER

some of my functions are like this:

Private Class RuleMgr
        Public Function MethodA(dim Description as String) As String
            Return ""
        End Function
End Class

I want to capture the "Description" parameter as well. Nothing fancy I just want to know it's there and the name description
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's almost like having another developer on staff!