Esempio n. 1
0
        public virtual void LoadDirectory(TreeNodeCollection objNodes, CUserEntity user, int resourceId)
        {
            objNodes.Clear();

            //insert the root node
            List <CResourceEntity> children = user.ListDescendants(resourceId);

            foreach (CResourceEntity res in children)
            {
                if (res.Res_Type != (int)RESOURCETYPE.FOLDERRESOURCE)
                {
                    continue;
                }

                bool blnHasNodes            = false;
                List <CResourceEntity> list = user.ListResources(res.Res_Id);
                foreach (CResourceEntity r in list)
                {
                    if (r.Res_Type == (int)RESOURCETYPE.FOLDERRESOURCE)
                    {
                        blnHasNodes = true;
                        break;
                    }
                }

                TreeNode objNode = new TreeNode(res.Res_Name);
                objNode.Tag = res.Res_Id;

                objNode.IsExpanded = !blnHasNodes;
                objNode.HasNodes   = blnHasNodes;

                objNode.Loaded = !blnHasNodes;
                objNodes.Add(objNode);
            }
        }
Esempio n. 2
0
        public override List <File> GetFiles(CUserEntity user, int parentId)
        {
            List <CResourceEntity> children;
            List <File>            ret = new List <File>();

            if (parentId == 0)
            {
                children = user.ListShareResources();
            }
            else
            {
                children = user.ListResources(parentId);
            }

            foreach (CResourceEntity res in children)
            {
                if (res.Res_Type != (int)RESOURCETYPE.FILERESOURCE)
                {
                    continue;
                }
                File f = new File(res.Res_Id, res.Res_Name);
                ret.Add(f);
            }

            return(ret);
        }
Esempio n. 3
0
        public virtual List <File> GetFiles(CUserEntity user, int parentId)
        {
            //insert the root node
            List <CResourceEntity> children = user.ListResources(parentId);
            List <File>            ret      = new List <File>();

            foreach (CResourceEntity res in children)
            {
                if (res.Res_Type != (int)RESOURCETYPE.FILERESOURCE)
                {
                    continue;
                }
                File f = new File(res.Res_Id, res.Res_Name);
                ret.Add(f);
            }

            return(ret);
        }