Ejemplo n.º 1
0
 public GlycanTreeNode GetGlycanTreeByID(int argID)
 {
     foreach (GlycanTreeNode t in _tree.TravelGlycanTreeBFS())
     {
         if (t.NodeID == argID)
         {
             return(t);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        public static TreeNode Convert2TreeView(GlycanTreeNode argRoot)
        {
            Stack <GlycanTreeNode> NodeStack = new Stack <GlycanTreeNode>();

            NodeStack.Push(argRoot);
            TreeNode root = new TreeNode(argRoot.NodeID + "-" + argRoot.GlycanType.ToString());

            foreach (GlycanTreeNode GN in argRoot.TravelGlycanTreeBFS())
            {
                if (GN.Parent == null)
                {
                    continue;
                }
                string   PID        = GN.Parent.NodeID + "-" + GN.Parent.GlycanType.ToString();
                TreeNode ParentNode = FindNode(root, PID);
                ParentNode.Nodes.Add(GN.NodeID + "-" + GN.GlycanType.ToString());
            }
            return(root);
        }