S
Sam Marrocco
If an object is the child of another object, is it possible to refer to
the parent's properties? Put simply (in pseudocode),
Public Class MyChild_Class
Public NameOfChild as string
End Class
Public Class MyParent_Class
Public NameOfParent As String
Public Child as MyChild_Class
End Class
dim a as MyParent_Class
a.NameOfParent="Dad"
a.NameOfChild="Billy"
Console.WriteLine(a.Child.PARENTOBJECTBASE.NameOfParent)
Ideally, I'd like something for PARENTOBJECTBASE that can refer to
whatever class is the "containing parent class" for my child object. I
suppose I'm looking for something similiar to MyBase (which only works
with classes that are *inherited*, which my class is *not*).
I'm trying *not* to have to include the parent info in each child if at
all possible, hence my quest for this method. Is it possible?
the parent's properties? Put simply (in pseudocode),
Public Class MyChild_Class
Public NameOfChild as string
End Class
Public Class MyParent_Class
Public NameOfParent As String
Public Child as MyChild_Class
End Class
dim a as MyParent_Class
a.NameOfParent="Dad"
a.NameOfChild="Billy"
Console.WriteLine(a.Child.PARENTOBJECTBASE.NameOfParent)
Ideally, I'd like something for PARENTOBJECTBASE that can refer to
whatever class is the "containing parent class" for my child object. I
suppose I'm looking for something similiar to MyBase (which only works
with classes that are *inherited*, which my class is *not*).
I'm trying *not* to have to include the parent info in each child if at
all possible, hence my quest for this method. Is it possible?