Example #1
0
        public void FromBatch(NBatchInfoGroup group)
        {
            if (((group != null) && (group.Batchs != null)) && (group.Batchs.Count > 0))
            {
                NBatchInfo       batchInfo = group.Batchs[0];
                RadTreeNode      batchNode = CreateBatchNode(batchInfo);
                List <NFileInfo> fileInfos = batchInfo.FileInfos;

                //fileInfos.ForEach(x => x.FileName = x.FileNO);
                //HashSet<String> categorys = new HashSet<string>();

                foreach (NFileInfo fileInfo in fileInfos)
                {
                    string category = fileInfo.Category;
                    if (String.IsNullOrEmpty(category)) //没有分类的文件
                    {
                        CreateFileNodeFromServer(batchNode, fileInfo, batchInfo);
                    }
                    else
                    {
                        String      path         = batchNode.Text + "." + category;
                        RadTreeNode categoryNode = navigateTree.GetNodeByPath(path, ".");
                        if (categoryNode == null)
                        {
                            categoryNode = navigateTree.AddNodeByPath(path, ".");
                            UpdateCategoryNode(categoryNode);
                            categoryNode.Parent.Nodes.Move(categoryNode.Index, 0);  //将分类节点移到父节点最前面的位置
                        }
                        CreateFileNodeFromServer(categoryNode, fileInfo, batchInfo);
                    }
                }
                batchNode.ExpandAll();
                UpdateBatchNodeTitle(batchNode);
            }
        }