Example #1
0
 private void BuildTreeNode(Simulatable item, TreeNode parentNode)
 {
     TreeNode node = new TreeNode(item.NameOrDefault);
     node.Name = item.GetHashCode().ToString();
     if (parentNode == null) treeView.Nodes.Add(node);
     else parentNode.Nodes.Add(node);
     foreach (Simulatable child in item.PersistentSimulatableChildren) BuildTreeNode(child, node);
 }
Example #2
0
 private TreeNode GetTreeNode(Simulatable item)
 {
     if (item == null) return null;
     TreeNode[] nodes = treeView.Nodes.Find(item.GetHashCode().ToString(), true);
     return nodes.FirstOrDefault();
 }