Esempio n. 1
0
 /// <summary>
 /// 创建本次遍历获取的叶子节点
 /// </summary>
 /// <param name="parentPath"></param>
 /// <param name="item"></param>
 /// <param name="parentNode"></param>
 /// <param name="splitchar"></param>
 /// <returns></returns>
 protected virtual void CreateLeafNode(string parentPath, TreeViewNodeInfor item, TreeNodeBase parentNode, char splitchar)
 {
     //TreeViewNodeInfor_ActionNode nodeInfor = item as TreeViewNodeInfor_ActionNode;
     //parentPath = parentPath + nodeInfor.m_Arrangenment + splitchar;  //当前需要创建的树节点的完整路径
     //TreeNodeBase node = GetClassficationNodeByName(parentPath);  //判断是否存在这个路径的节点
     //if (node == null)
     //{
     //    node = new TreeNodeBase(nodeInfor.m_Arrangenment, parentNode);  //创建当前节点
     //    RecordClassfication(parentPath, node); //记录当前创建的节点
     //}//当前子目录不存在
 }
Esempio n. 2
0
        /// <summary>
        /// 分割节点路径并按照路径层级关系创建合适的节点以及关联父节点
        /// </summary>
        /// <param name="item">包含当前节点路径的对象</param>
        /// <param name="parentPath">已经分割完成的路径</param>
        /// <param name="splitchar">分隔符</param>
        protected virtual void CreateTreeNode(TreeViewNodeInfor item, string parentPath, char splitchar = '/')
        {
            //    TreeNodeBase parentNode = null;
            //    if (string.IsNullOrEmpty(parentPath))
            //        parentNode = m_Root;
            //    else
            //        parentNode = GetClassficationNodeByName(parentPath);  //获取当前节点所属于的父级分类节点

            //    string[] segment = itemPath.Split(splitchar);//分割字符串判断层级目录
            //    if (segment.Length == 1)
            //    {
            //        parentPath = CreateNode(parentPath, segment[0], parentNode, splitchar);
            //    }  //当前字符串层级关系确定完
            //    else
            //    {
            //        parentPath = CreateNode(parentPath, segment[0], parentNode, splitchar);  //更新新的父节点路径
            //        itemPath = itemPath.Remove(0, (segment[0] + splitchar).Length);  //去掉一个层级目录后的路径
            //        CreateTreeNode(itemPath, parentPath, splitchar);
            //    }
        }