Ejemplo n.º 1
0
        public int AddNode(string key, string path = "/")
        {
            string[]        nodePath = path.Split('/');
            CompanyTreeNode nowNode  = root;

            Console.WriteLine("{0}", nodePath.Length);
            foreach (string selection in nodePath)
            {
                if (selection == "")
                {
                    break;
                }
                nowNode = nowNode.data[selection];
            }
            CompanyTreeNode department = new CompanyTreeNode(nowNode.level + 1);

            nowNode.data.Add(key, department);

            return(1);
        }
Ejemplo n.º 2
0
 public CompanyTree()
 {
     this.root = new CompanyTreeNode(0);
 }