public static CFBElement ParseHierarchy(int DirID, CFBFile File, CFBElement Parent = null) { CFBDirectoryEntry Root = new CFBDirectoryEntry(DirID, File); CFBElement Elem = new CFBElement(Root, File); if (Parent != null) { Parent.Children.Add(Elem); } if (Root.DirIDLeftChild >= 0) { ParseHierarchy(Root.DirIDLeftChild, File, Parent); } if (Root.DirIDRightChild >= 0) { ParseHierarchy(Root.DirIDRightChild, File, Parent); } if (Root.DirIDRoot >= 0) { ParseHierarchy(Root.DirIDRoot, File, Elem); } return(Elem); }
public CFBElement(CFBDirectoryEntry Entry, CFBFile File) { Stopwatch sw = new Stopwatch(); sw.Start(); this.Entry = Entry; this.File = File; if (this.Entry.FirstSecID > 0) { if (this.Entry.ShortStream) { } else { this.Data = GetData(this, File).ToList(); } } sw.Stop(); Console.WriteLine("Loaded node {2} ({0}) of {3} bytes in {1}ms {4}kb/s", Entry.DirID, sw.ElapsedMilliseconds, Entry.Name, this.Data.Count, this.Data.Count / (sw.ElapsedMilliseconds > 0?sw.ElapsedMilliseconds:1)); }