private void setFileTreeFromImage(absImageStream i) { TreeNode partitionTN = new TreeNode(); fileTree = null; fileTree = new TreeNode(); switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); foreach (GPTScheme.entry partition in ps.getValidTable()) { GPTScheme.partitionType type = ps.findPartitionType(partition); partitionTN = getVolumeTree(partition, type); partitionTN.Text = partition.name; fileTree.Nodes.Add(partitionTN); } break; default: break; } }
public TreeNode getSubDirectories(TreeNode tn) { TreeNode result = tn; GPTScheme gpts = new GPTScheme(i); if (tn.Tag is HFSPlusCatalogFolder) { HFSPlusCatalogFolder folder = (HFSPlusCatalogFolder)tn.Tag; HFSPlus hfsp = new HFSPlus(i, gpts.getValidTable()[folder.partitionAssoc]); volumeStream vs = new volumeStream(hfsp); extentsOverflowFile eof = new extentsOverflowFile(new HFSPlusFile(hfsp.volHead.extentsFile, forkStream.forkType.data), vs); catalogFile cf = new catalogFile(new HFSPlusFile(hfsp.volHead.catalogFile, forkStream.forkType.data), vs); result = hfsp.getDirectoryChildren(folder, cf, eof); result.Tag = tn.Tag; } return(result); }
public void generateListViewContent(TreeNode startDirectory) { TreeNode partitionTN = new TreeNode(); if (startDirectory.Tag is absImageStream.imageProperties) { switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); foreach (GPTScheme.entry partition in ps.getValidTable()) { GPTScheme.partitionType type = ps.findPartitionType(partition); partitionTN = getVolumeTree(partition, type); partitionTN.Text = partition.name; } break; default: break; } } else if (startDirectory.Tag is HFSPlusCatalogFolder) { HFSPlusCatalogFolder tag = (HFSPlusCatalogFolder)startDirectory.Tag; switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); // if used, the following line causes the program to display only the direct children of the selected directory partitionTN = getSubDirectories(startDirectory); // if used, the following line will cause the program to display the entire contents of a directory tree branch recursively // partitionTN = getVolumeTree(ps.getValidTable()[tag.partitionAssoc], GPTScheme.partitionType.HFSPlus, tag); partitionTN.Text = startDirectory.Text; break; default: break; } } else if (startDirectory.Tag is HFSPlus.volumeHeader) { HFSPlus.volumeHeader tag = (HFSPlus.volumeHeader)startDirectory.Tag; switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); partitionTN = getVolumeTree(ps.getValidTable()[tag.partitionNo], GPTScheme.partitionType.HFSPlus); partitionTN.Text = startDirectory.Text; break; default: break; } } if (startDirectory.Tag != null) { addRowsToList(partitionTN); } }
public TreeNode getSubDirectories(TreeNode tn) { TreeNode result = tn; GPTScheme gpts = new GPTScheme(i); if (tn.Tag is HFSPlusCatalogFolder) { HFSPlusCatalogFolder folder = (HFSPlusCatalogFolder)tn.Tag; HFSPlus hfsp = new HFSPlus(i, gpts.getValidTable()[folder.partitionAssoc]); volumeStream vs = new volumeStream(hfsp); extentsOverflowFile eof = new extentsOverflowFile(new HFSPlusFile(hfsp.volHead.extentsFile, forkStream.forkType.data), vs); catalogFile cf = new catalogFile(new HFSPlusFile(hfsp.volHead.catalogFile, forkStream.forkType.data), vs); result = hfsp.getDirectoryChildren(folder, cf, eof); result.Tag = tn.Tag; } return result; }
public void generateListViewContent(TreeNode startDirectory) { TreeNode partitionTN = new TreeNode(); if (startDirectory.Tag is absImageStream.imageProperties) { switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); foreach (GPTScheme.entry partition in ps.getValidTable()) { GPTScheme.partitionType type = ps.findPartitionType(partition); partitionTN = getVolumeTree(partition, type); partitionTN.Text = partition.name; } break; default: break; } } else if (startDirectory.Tag is HFSPlusCatalogFolder) { HFSPlusCatalogFolder tag = (HFSPlusCatalogFolder)startDirectory.Tag; switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); // if used, the following line causes the program to display only the direct children of the selected directory partitionTN = getSubDirectories(startDirectory); // if used, the following line will cause the program to display the entire contents of a directory tree branch recursively // partitionTN = getVolumeTree(ps.getValidTable()[tag.partitionAssoc], GPTScheme.partitionType.HFSPlus, tag); partitionTN.Text = startDirectory.Text; break; default: break; } } else if (startDirectory.Tag is HFSPlus.volumeHeader) { HFSPlus.volumeHeader tag = (HFSPlus.volumeHeader) startDirectory.Tag; switch (i.scheme) { case absImageStream.schemeType.GPT: GPTScheme ps = new GPTScheme(i); partitionTN = getVolumeTree(ps.getValidTable()[tag.partitionNo], GPTScheme.partitionType.HFSPlus); partitionTN.Text = startDirectory.Text; break; default: break; } } if (startDirectory.Tag != null) { addRowsToList(partitionTN); } }