DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Andy Guest

    Nested collections in VB.Net


    Hello

    I would like to recreate the same functionality as the example below


    Collection1("id").Collection2("ID").Collection3("ID").SomeProperty=somevalue


    I do know that all collections in this examples will have to be derived from
    classes because each of these collections have different properties and methods.
    But how exactly do I do that?


    Yours truly


    Andy

  2. #2
    Patrice Scribe Guest

    Re: Nested collections in VB.Net

    Not sure to understand. You could create a collection using CollectionBase
    (or even something else that would be closer from what you need).
    I don't see what specific problem could cause the this imbrication. if all
    these collections have their own properties/method (I assume you want
    strongly typed collections ?) you'll just have 3 different collection
    classes.

    "Andy" <x_terminat_or@yahoo.fr> a écrit dans le message de news:
    3da2912f$1@10.1.10.29...
    >
    > Hello
    >
    > I would like to recreate the same functionality as the example below
    >
    >
    >

    Collection1("id").Collection2("ID").Collection3("ID").SomeProperty=somevalue
    >
    >
    > I do know that all collections in this examples will have to be derived

    from
    > classes because each of these collections have different properties and

    methods.
    > But how exactly do I do that?
    >
    >
    > Yours truly
    >
    >
    > Andy




  3. #3
    Paul Mc Guest

    Re: Nested collections in VB.Net


    G'day Andy.


    >I would like to recreate the same functionality as the example below
    >
    >
    >Collection1("id").Collection2("ID").Collection3("ID").SomeProperty=somevalue


    Something like this would do it:

    Public Class MyFirstColl
    ...
    Public Default Property Item(Byval Identifier as String ) as AnObject
    ...
    End Property
    ...
    End Class

    Public Class MySecondColl
    ...
    Public Default Property Item(Byval Identifier as String) As MyFirstColl
    ...
    'Get/Set your Instance of MyFirstColl here
    ...
    End Property
    ...
    End Class


    etc etc

    HTH,
    Cheers,
    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links