Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oop and VB.NET
Message
From
13/06/2012 22:39:20
 
 
To
13/06/2012 13:44:02
General information
Forum:
ASP.NET
Category:
Object Oriented Programming
Title:
Environment versions
OS:
Windows 7
Miscellaneous
Thread ID:
01545984
Message ID:
01546006
Views:
69
You shouldn't do that. In fact, the property needs a data type that specifies the data type or type that it holds. If you need a property to hold more than one value, then you should use two different properties.

>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
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform