public Department(string name, Department[] children, Employee[] employees) { this.name = name; this.children = children; this.employees = employees; }
private TreeNode CreateTreeNode(Department d) { TreeNode n = Tree.CreateTreeNode(); Tree.SetTreeNodeText(n, d.name); Tree.SetTreeNodeData(n, d.employees); if (d.children != null) { foreach (var c in d.children) { TreeNode x = CreateTreeNode(c); Tree.AddTreeNodeChild(x, n); } } return n; }