Example #1
0
 public bool is_parent_of(HierarchicalData <T> tree)
 {
     foreach (var node in childrens)
     {
         if (node == tree || node.is_parent_of(tree))
         {
             return(true);
         }
     }
     return(false);
 }
Example #2
0
 public void addChild(HierarchicalData <T> child_data)
 {
     childrens.Add(child_data);
     child_data.parent = this;
 }
Example #3
0
 public HierarchicalData(T value, HierarchicalData <T> parent_value)
 {
     this.data   = value;
     this.parent = parent_value;
 }