![]() There are a few nice articles and guides in Microsoft Docs which explains the architecture of the visualizers and teach you how to create an install a simple visualizer. Then, when you are debugging your application wherever you have a breakpoint for the node class, you will see the visualizer icon:Īnd if you click on it, you can see your custom visualizer, which could be a Form containing a TreeView:Ĭreate a custom debugger visualizer for my tree-like data structure I take the following statement and as I mentioned in the comments, as an idea you can also Create a custom data visualizer to use in Visual Studio to visualize your data at debug-time. TreeNode root = new TreeNode("Root node") įor speed, I would prefer an iterative solution, but a recursive solution would be fine too. The method skeleton would look like this: private void convertNodetreetoTreeview(node n) I understand and have implemented preorder and inorder traversal for a minimax algorithm, and so I was wondering if I could utilize some of that code to help with converting from my own node tree to a TreeView tree. Large trees especially are difficult to probe visually.įor this reason, I had the brain wave to use Winform's TreeView control to display the data so I can more easily visualize what's going on. Unfortunately, I've come across a point in my program where it's getting very hard to debug due to the nature of trees. This is a simplified version of the class: public class node Using C#, I have created a "node" class (which contains a List of type itself) to allow for recursive tree-like data structures.
0 Comments
Leave a Reply. |