public IdentifiedTreeNode getNodeWithID(int goalID)
 {
     if (this.id == goalID)
     {
         return(this);
     }
     foreach (IdentifiedTreeNode i in Nodes)
     {
         IdentifiedTreeNode temp = i.getNodeWithID(goalID);
         if (temp != null)
         {
             return(temp);
         }
     }
     return(null);
 }
Пример #2
0
 public override IdentifiedTreeNode createTree()
 {
     if (children.Count == 0)
     {
         return(new IdentifiedTreeNode(this.Name + " - Folder, " + numOfCharacters() + " characters", this.id));
     }
     else
     {
         IdentifiedTreeNode[] childTree = new IdentifiedTreeNode[this.children.Count];
         for (int i = 0; i < childTree.Length; i++)
         {
             childTree[i] = getChild(i).createTree();
         }
         return(new IdentifiedTreeNode(this.Name + " - Folder, " + numOfCharacters() + " characters", childTree, this.id));
     }
 }