-
Need help on collection
Hi all,
I would like to know what the best container to use for a multiple type objects.
For example, i have 3 structures, Line, Rectangle and Ellipse:
Public Structure Line
Public Point1, Point2 as Point
Pubilc LineColor as Color
Public Selected as Boolean
End Structure
Public Structure Rectangle
Public Point1 as Point
Public LineColor as Color
Public Height, Width as Integer
Public Selected as Boolean
End Structure
Public Structure Ellipse
Public Point1 as Point
Public LineColor as Color
Pubilc Height, Width as Integer
Public Selected as Boolean
End Structure
What would be the best container to use to store multiple type objects? Would an Arraylist be the best solution?
Thanks
-
You could always create your own custom collection that inherits from collectionbase. That's what I do, then I can add all the nice methods that make it real easy to work with.
-
Any coding examples? Thanks