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); } }
private string GetTreeNodeText(ITreeAccess node) { return($"[{ node.Id }] { node.Name } - { node.Type }"); }