Exemple #1
0
 private void LoadTree(ITreeAccess root, TreeView treeView, TreeNode rootNode = null)
 {
     foreach (ITreeAccess child in root.Children)
     {
         TreeNodeCollection nodes;
         if (rootNode == null)
         {
             nodes = treeView.Nodes;
         }
         else
         {
             nodes = rootNode.Nodes;
         }
         TreeNode node = nodes.Add(child.Id.ToString(), child.Name);
         LoadTree(child, treeView, node);
     }
 }
Exemple #2
0
 private string GetTreeNodeText(ITreeAccess node)
 {
     return($"[{ node.Id }] { node.Name } - { node.Type }");
 }