Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oop and VB.NET
Message
From
13/06/2012 13:44:02
 
 
To
All
General information
Forum:
ASP.NET
Category:
Object Oriented Programming
Title:
Oop and VB.NET
Environment versions
OS:
Windows 7
Miscellaneous
Thread ID:
01545984
Message ID:
01545984
Views:
112
Hello All,

I am new to VB.NET and Object Oriented Programming, so please bare with me on this, my question is as follows:

I would like to know if it is possible to have a property return different Structures or classes, please see the following code:
    Public Overloads Property Parameter() As Test1Parameters
        Get
            Return oTest1Parameters
        End Get
        Set(ByVal value As Test1Parameters)
            oTest1Parameters = value
        End Set
    End Property

    Public Overloads Property Parameter() As Test2Parameters
        Get
            Return oTest2Parameters
        End Get
        Set(ByVal value As Test2Parameters)
            oTest2Parameters = value
        End Set
    End Property
Where Test1Parameters and Test2Parameters would be defined as follows:
    Public Class Test1Parameters
        Private Test1Field1 As String
        Private Test1Field2 As String
        Private Test1Field3 As String
        Private Test1Field4 As String
    End Class

    Public Class Test2Parameters
        Private Test2Field1 As String
        Private Test2Field2 As String
        Private Test2Field3 As String
        Private Test2Field4 As String
    End Class
Thank You

Gary
Next
Reply
Map
View

Click here to load this message in the networking platform