I have a number of collections and objects set up that have a one-to-many relationship that is four levels deep. CollectionA
contains a number of CollectionB
objects and CollectionB
contains a number of CollectionC
objects and CollectionC
contains a number of Content
objects.
After the user has spent time populating all of these collections and objects with the necessary data, they need to be able to save all of the properties of each object and then read the output file and start where they left off.
I know this is a somewhat broad question so I'm looking to see which direction I should head in my research on how to do this. Right now I'm most concerned with the File I/O and I'm thinking of two different routes.
It's an excel project, so I was thinking I could loop through all of the Collections and objects from the top down and write their values to a spreadsheet and then loop through the spreadsheet rows and output those to a delimited text file. Then do the reverse to read the text file back in - from text to spreadsheet, then from spreadsheet into collections and objects.
Maybe the other option would be to bypass the spreadsheet and use a TextStream? Would that be possible and would it be the way to go if I'm planning on converting this VBA application to standalone VB.NET sometime in the future?