Hi Andrew,
class inheritance means that :
if you have a class A that inherit class B so the class A has all class B
caracteristics (Public and Protected attributes, procedures and functions).
it's like if you say that a baby got the eyes of his father and the mouth of
his mother;
Now what you want to do (if I understand) is to have a class Customer that
have an attribute Emails (which is a class or a collection of classes) wich
have a reference to the Customer class;
To do that, create your class Emails with a constructor which take the
Customer class in parameter and store it in an Emails class attribute :
Class Emails
Protected myCustomer as Customer
Public Sub new (Byref c As Customer)
myCustomer = c
End Sub
...
End Class
Regards
"Andrew" <an*****@nospam.dbasplus.com> a écrit dans le message de
news:%2***************@TK2MSFTNGP09.phx.gbl...
I need to have a series of collection classes that inherit (I think) from
each other. What is the best way to do this in .NET? In VB6 I had a series
of collection classes each passing a reference to the parent object down
the tree.
For example:
Customer(s) -> Email(s) -> Attachment(s)
Or maybe:
Directory -> Directory -> Directory -> Files etc
Do I still simply pass teh reference to the parent down the tree?
I also need the child classes to get information form the parent.
You also can't put:
Public Class cAttachments
Inherits System.Collections.CollectionBase
Inherits cEmail
...