Example #1
0
        // Recurse down the folder tree, building a structure of Folder classes
        private Folder ReadFolderStructure(FileStream fs, NID nid, Folder parentFolder = null)
        {
            Folder f = new Folder {
                Nid = nid, XstFile = this, ParentFolder = parentFolder
            };

            ltp.ReadProperties <Folder>(fs, nid, pgFolder, f);

            f.Folders.AddRange(ltp.ReadTableRowIds(fs, NID.TypedNID(EnidType.HIERARCHY_TABLE, nid))
                               .Where(id => id.nidType == EnidType.NORMAL_FOLDER)
                               .Select(id => ReadFolderStructure(fs, id, f))
                               .OrderBy(sf => sf.Name)
                               .ToList());
            return(f);
        }
Example #2
0
        // Recurse down the folder tree, building a structure of Folder classes
        private Folder ReadFolderStructure(FileStream fs, NID nid)
        {
            Folder f = new Folder {
                Nid = nid
            };

            ltp.ReadProperties <Folder>(fs, nid, pgFolder, f);

            foreach (var sf in ltp.ReadTableRowIds(fs, NID.TypedNID(EnidType.HIERARCHY_TABLE, nid))
                     .Where(id => id.nidType == EnidType.NORMAL_FOLDER)
                     .Select(id => ReadFolderStructure(fs, id))
                     .OrderBy(sf => sf.Name))
            {
                f.Folders.Add(sf);
            }

            return(f);
        }