Example #1
0
        private void WriteDirectoryNode(BinaryWriter bw, CompoundFileData.RedBlackTreeNode node)
        {
            CompoundFileData.DirectoryEntryType rootStorage;
            int shortStreamContainerSID;
            int shortStreamContainerSize;
            Ole2DirectoryEntry directoryEntry = node.DirectoryEntry;

            if (directoryEntry == this.ole2File.root)
            {
                rootStorage              = CompoundFileData.DirectoryEntryType.RootStorage;
                shortStreamContainerSID  = base.shortStreamContainerSID;
                shortStreamContainerSize = base.shortStreamContainerSize;
            }
            else if (directoryEntry is Ole2Storage)
            {
                rootStorage              = CompoundFileData.DirectoryEntryType.UserStorage;
                shortStreamContainerSID  = 0;
                shortStreamContainerSize = 0;
            }
            else
            {
                if (!(directoryEntry is Ole2Stream))
                {
                    throw new CompoundFileException("Internal error: unrecognized entry type.");
                }
                Ole2Stream stream = (Ole2Stream)node.DirectoryEntry;
                rootStorage              = CompoundFileData.DirectoryEntryType.UserStream;
                shortStreamContainerSID  = stream.WriteSID;
                shortStreamContainerSize = stream.Size;
            }
            string name = directoryEntry.Name;
            string str2 = name;

            for (int i = 0; i < str2.Length; i++)
            {
                char ch = str2[i];
                bw.Write(ch);
            }
            int num3 = 0x20 - name.Length;

            for (int j = 0; j < num3; j++)
            {
                bw.Write(0);
            }
            bw.Write((ushort)((name.Length + 1) * 2));
            bw.Write((byte)rootStorage);
            bw.Write(0);
            bw.Write(node.LeftDID);
            bw.Write(node.RightDID);
            bw.Write(node.MembersDID);
            bw.Write(directoryEntry.UniqueIdentifier);
            bw.Write(directoryEntry.UserFlags);
            bw.Write(directoryEntry.TimeStampCreation);
            bw.Write(directoryEntry.TimeStampModification);
            bw.Write(shortStreamContainerSID);
            bw.Write(shortStreamContainerSize);
            bw.Write(directoryEntry.NotUsed);
        }
Example #2
0
 internal VisitDirectoryEntryArgs(Ole2DirectoryEntry currentEntry, Ole2DirectoryEntry parentEntry, int level, bool visitSiblings, bool visitChildren, bool continueVisiting, ArrayList levelTags)
 {
     this.currentEntry     = currentEntry;
     this.parentEntry      = parentEntry;
     this.level            = level;
     this.visitSiblings    = visitSiblings;
     this.visitChildren    = visitChildren;
     this.continueVisiting = continueVisiting;
     this.levelTags        = levelTags;
 }
Example #3
0
 internal void Add(Ole2DirectoryEntry entry)
 {
     this.elements.Add(entry);
 }