Beispiel #1
0
        private void initTreeView(Stream stream, String fn)
        {
            WAC.FOLDER root;
            wac = new WAC(stream, fn);

            treeView1.BeginUpdate();
            treeView1.Nodes.Clear();

            root = wac.GetRoot();
            TreeNode node = new TreeNode(root.fileName);
            treeView1.Nodes.Add(AddFolderChildren(root));

            treeView1.EndUpdate();
            //wac.Close();
        }
Beispiel #2
0
        private TreeNode AddFolderChildren(WAC.FOLDER folderInfo)
        {
            TreeNode dirNode = new TreeNode(folderInfo.fileName);
            foreach (WAC.FOLDER folder in wac.GetFolders(folderInfo))
            {
                TreeNode foldernode = AddFolderChildren(folder);
                foldernode.Tag = folder;
                dirNode.Nodes.Add(foldernode);
            }
            foreach (WAC.FILE file in wac.GetFiles(folderInfo))
            {
                TreeNode filenode = new TreeNode(file.fileName);
                filenode.Tag = file;
                dirNode.Nodes.Add(filenode);
            }

            return dirNode;
        }
Beispiel #3
0
 private void WriteExtract(WAC.FILE test)
 {
     byte[] buf = wac.ExtractFile(test);
     Stream outFile = File.Open(test.fileName, FileMode.Create);
     outFile.Write(buf, 0, (int)test.size);
     outFile.Close();
 }