コード例 #1
0
 public void _FromRadTree(RadTreeNode treerootnode)
 {
     this.RootNode = null;
     if (treerootnode != null)
     {
         LinkedList <RadTreeNode> linkedList   = new LinkedList <RadTreeNode>();
         TemplateNode             templateNode = new TemplateNode();
         templateNode.Name = treerootnode.Text;
         treerootnode.Tag  = templateNode;
         linkedList.AddLast(treerootnode);
         while (linkedList.Count > 0)
         {
             LinkedListNode <RadTreeNode> first = linkedList.First;
             bool flag2 = first.Value.Nodes.Count > 0;
             if (flag2)
             {
                 foreach (RadTreeNode current in first.Value.Nodes)
                 {
                     TemplateNode TemplateNode2 = new TemplateNode();
                     TemplateNode2.Name = current.Text;
                     current.Tag        = TemplateNode2;
                     (first.Value.Tag as TemplateNode).AddChild(TemplateNode2);
                     linkedList.AddLast(current);
                 }
             }
             linkedList.RemoveFirst();
         }
         this.RootNode = templateNode;
     }
 }
コード例 #2
0
        private void AddCategoryNodeByTemplateNode(RadTreeNode parentNode, TemplateNode templateNode)
        {
            RadTreeNode categoryNode = CreateCategoryNode(parentNode, new NCategoryInfo()
            {
                CategoryName = templateNode.Name
            });

            if (templateNode.HasChildren())
            {
                foreach (TemplateNode templateChild in templateNode.Children)
                {
                    AddCategoryNodeByTemplateNode(categoryNode, templateChild);
                }
            }
        }
コード例 #3
0
 private void AddTemplateNodeFromTreeNode(TemplateNode templateNode, RadTreeNode radTreeNode)
 {
     if (radTreeNode.Nodes.Count > 0)
     {
         foreach (RadTreeNode radTreeChild in radTreeNode.Nodes)
         {
             TemplateNode templateChild = new TemplateNode()
             {
                 Name = radTreeChild.Text
             };
             templateNode.AddChild(templateChild);
             AddTemplateNodeFromTreeNode(templateChild, radTreeChild);
         }
     }
 }
コード例 #4
0
        public RadTreeNode FromBatchTemplate(BatchTemplateDef template, NBatchInfo batchInfo)
        {
            RadTreeNode  batchNode    = null;
            TemplateNode templateRoot = template.RootNode;

            if (templateRoot != null)
            {
                batchNode = CreateBatchNode(batchInfo);
                if (templateRoot.HasChildren())
                {
                    foreach (TemplateNode templateChild in templateRoot.Children)
                    {
                        AddCategoryNodeByTemplateNode(batchNode, templateChild);
                    }
                }
            }
            return(batchNode);
        }
コード例 #5
0
        public static RadTreeNode _CreateTemplateTree(RadTreeView tree, BatchTemplateDef bat, String nodeText)
        {
            RadTreeNode batchNode;

            if (bat == null)
            {
                //RadTreeNode batchNode = NavigateTreeHelper.CreateBatchNode(tree, batchInfo, null);
                batchNode = tree.Nodes.Add(nodeText);
                //tree.Refresh();
                batchNode.Selected = true;
                //result = batchNode;
            }
            else
            {
                LinkedList <TemplateNode> linkedList = new LinkedList <TemplateNode>();
                linkedList.AddLast(bat.RootNode);
                batchNode = tree.Nodes.Add(nodeText);
                //RadTreeNode batchNode = NavigateTreeHelper.CreateBatchNode(tree, batchInfo, null);
                tree.Refresh();
                bat.RootNode.Tag = batchNode;
                while (linkedList.Count > 0)
                {
                    TemplateNode value = linkedList.First.Value;
                    if (value.Children != null && value.Children.Count > 0)
                    {
                        RadTreeNode radTreeNode3 = value.Tag as RadTreeNode;
                        foreach (TemplateNode current in value.Children)
                        {
                            RadTreeNode radTreeNode4 = radTreeNode3.Nodes.Add(current.Name);
                            radTreeNode4.ShowCheckBox = false;
                            radTreeNode4.Tag          = new NCategoryInfo(current.Name);
                            current.Tag = radTreeNode4;
                            linkedList.AddLast(current);
                        }
                    }
                    linkedList.RemoveFirst();
                }
                batchNode.ExpandAll();
                batchNode.Selected = true;
            }
            return(batchNode);
        }
コード例 #6
0
 public void AddChild(TemplateNode node)
 {
     this._children.Add(node);
 }