Having a treeview control on a form which will be used to visually represent both folders and text files that the user will create, rename, and delete in an arbitrary hierarchy as they see fit, how should one go about managing the relationships and user interaction that will exist between the individual nodes in the treeview and the underlying folders and files?
Edit \ Update:
As an example of user interaction suppose I select an existing node in the treeview and via a right-click context menu I rename that node, how do I go about building a string representing the path to that particular node that I could pass to some sort of method which would would carry out the associated action on the underlying folder.
This will not be a comprehensive answer, but one important practice is to lazy-populate collapsed nodes. That is, only enumerate the next level down when a user explicitly requests expansion of the node.
This is why we often see a “plus sign” on a directory node, click to expand, and then find it to be empty.
At a higher level, the Composite Pattern is directly relevant — it is the canonical approach to implementing tree structures. Learn it, use it, love it.