i have a huge Problem and i don´t know with which methode i should solve it...
The current state of the Program: The User is currently able to create new Items of a ToolMenuStrips during runtime. The MenuStrip ALWAYS has 3 Layers. for example: Parent - Child 1 - Child of Child1. There can be multiple Parents, multiple Childs and multiple Child of Childs, only Rule is they cant have the same name. If i click on the 3. Layer it opens an Event which gives me the Name of the 3. Layer i clicked on. (Note: The ID/Names of the Items are like this : Parent= ParentName ; Child= ParentName+ChildName ; Child of Child = ParentName+ChildName+Child of ChildName) This all works great!
The "Problem" : Now the 3rd Layer (child of child) is created along with some Informations(including a Path and Filename), which are stored in an array. This array need to be bound to the 3rd layer.
My goal: When adding a new 3rd Layer the Filename and Path of it should be add to a list of an Observer who is waiting for new Files with the FIlename to be created in the Folder. (So i have multiple Paths im observing at the same time) Furthermore when the User clicks on a 3rd Layer it opens an instance of a Form, to create the istance of this Form i need to pass the Informations bound to this 3. Layer. Which then will be displayed.
The next steps of the Program: I need the dynamic created MenuStripItems with the Informations to be stored in settings or XML so the program can load the whole datas again upon different Runtime (closing and restarting the program)
My Question: What is the best way to accomplish this? My ideas:
a.) using tuples -> (its hard to understand and probably garbage coding)
<string Parent, multidimensional array [childs,child of childs], map <string Filename, string Filepath>>
b.) using Model Classes -> Creating dynamic Classes *(I have no clue how to do that, i mean yes 1. dynamic Class = "Parents" Which gets the informations about all the Childs and Child of Childs and the other Informations as parameters on initialization, but how to deal with deleting some elements / adding some to it)
c.) I read something about "treeview" where you can initialize .Node with some Key Values, but i do not know if its the right thing for this?
d.)...?
Maybe this is easy to solve but i am lacking of knowledge... I know this is a farily open question but i have absolutely NO CLUE how this should be dealt with... I had an idea of storing all of it in just 1 Multidimensional Array but this is so messy that i dropped it... Since its hard to distinguish between Parent and its Childs and its Child of CHilds and so on... (a 10 Dimensional array would do though xD)
THANK YOU in advance!
Best regards,
Christian
Edit: Example of the Informations: Example with 1 Parent (there can be Multiple of them named different than A1 -> A2 for example with the same Name of childs)
A1 // Parent
B1 // child of HG1
B2 // other child of HG1
C1 // Child of B1
C2 // another Child of B1
C3 // child of B2
Now when C1,C2,C3 are created each of them has a List like this:
List ListC1= {StringnameC1,StringpathC1,PictureC1;}
List ListC2= {StringnameC2,StringpathC2,PictureC2;}
List ListC3= {StringnameC3,StringpathC3,PictureC3;}
The Problem is currently i dont save the List i get from a 2nd Form, i just overwrite it when i create a new ToolStripItems ( i need a way to store all Lists and acces them cleanly) And when i Click on the MenuStripItem C3 i need to access the ListC3 with its Items. On Top of that i need a simple way to Store all these Informations during runtimes.