Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

GetType

Posted on 2007-03-22
4
Medium Priority
?
270 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:thenrich
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 18772033
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
0
 
LVL 5

Author Comment

by:thenrich
ID: 18772083
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
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 18772147
Something like...

    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
                Debug.Print("Method: " & o.Name)
                For Each p As System.Reflection.ParameterInfo In o.GetParameters
                    Debug.Print("   Parameter: " & p.Name)
                    Debug.Print("        Type: " & p.ParameterType.ToString)
                Next
            End If
        Next
    End Sub
0
 
LVL 5

Author Comment

by:thenrich
ID: 18772370
It's almost like having another developer on staff!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question