Hi all!
I've got a little question regarding nested classes.
Is there a method in VB.NET that allows you to access data from a parent class in case you're working in a subclass?
I'm thinking of something like:
Me.Parent.Parent.Parent.Data
The reason is that I'd like to access data in the root class without having to pass on that data though each nestinglayer.
I use the following classes in a nested situation:
Class General
myNodeTypes as new enumNodeType
myCases as new list of Case
End Class
Class Case
myNetwork as new network
end Class
Class Network
myNodes as new list of Node
end Class
Class Node
Public ID as string
Public myNodeType as enmNodeType
end Class
As you can see, I'll have to access data (the enumerator data) that is stored in the root class "General" while creating a new instance of "Node". Well obviously I could pass on that enumerator data through every nesting step, but I don't think that's very elegant. Is there another way?
Any ideas will be appreciated! Thanks
Siebe
I've got a little question regarding nested classes.
Is there a method in VB.NET that allows you to access data from a parent class in case you're working in a subclass?
I'm thinking of something like:
Me.Parent.Parent.Parent.Data
The reason is that I'd like to access data in the root class without having to pass on that data though each nestinglayer.
I use the following classes in a nested situation:
Class General
myNodeTypes as new enumNodeType
myCases as new list of Case
End Class
Class Case
myNetwork as new network
end Class
Class Network
myNodes as new list of Node
end Class
Class Node
Public ID as string
Public myNodeType as enmNodeType
end Class
As you can see, I'll have to access data (the enumerator data) that is stored in the root class "General" while creating a new instance of "Node". Well obviously I could pass on that enumerator data through every nesting step, but I don't think that's very elegant. Is there another way?
Any ideas will be appreciated! Thanks
Siebe
Last edited: