Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public RadTreeNode CreateBatchNode(NBatchInfo batchInfo)
        {
            RadTreeNode batchNode = navigateTree.Nodes.Add(batchInfo.DisplayName);

            batchNode.Tag           = batchInfo;
            batchNode.AllowDrop     = false;
            batchNode.ItemHeight    = 50;
            batchNode.TextAlignment = ContentAlignment.MiddleCenter;
            batchNode.Image         = Properties.Resources.BatchIcno.GetThumbnailImage(40, 40, null, IntPtr.Zero);
            batchNode.Font          = new Font(Lev1NodeFont, Lev1NodeFontSize);
            batchNode.ContextMenu   = batchContextMenu;
            navigateTree.Refresh();
            batchNode.Selected = true;
            return(batchNode);
        }