CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2007
    Posts
    68

    Post Creating a custom datatype based on Reflection return type

    Hello

    I use reflection to invoke a method of an assembly. I can get the return type of the method using methodInfo.ReturnType

    The Return type is a Custom datatype(Class Info.Information) as follows.


    Code:
    public Class Info
    
        Public Class Sections
            Dim strSectionName As String = ""
            Dim ListRights As New List(String)
    
            Public Property SectionName() As String
                Get
                    Return strSectionName
                End Get
                Set(ByVal strValue As String)
                    strSectionName = strValue
                End Set
            End Property
    
            Public Property RightsInfo() As List(string)
                Get
                    Return ListRights
                End Get
                Set(ByVal ListVal As List(string))
                    ListRights = ListVal
                End Set
            End Property
        End Class
    
    
         public Class Information
              Dim ListSections As New List(Of Sections)
    
              Get
                    Return ListSections
                End Get
    
                Set(ByVal ListVal As List(Of Sections))
                    ListSections = ListVal
                End Set
         end class
    
    end class
    As Reflection is used, how can I create an object of Class Information and iterate through its values.

    Thanks in advance
    Last edited by HanneSThEGreaT; November 4th, 2014 at 01:03 PM. Reason: added code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured