Example #1
0
        /// <summary>
        /// Class Constructor
        /// </summary>
        /// <param name="file">The full path to the TPF file for reading</param>
        /// <param name="treefolder">The path to the directory containing the hash tree files</param>
        /// <param name="FormView">Should the class generate a form to view this TPF</param>
        public TPFExtract(String file, String treefolder, bool FormView)
        {
            _zippy = new ZipReader(file);

            Files = new List <string>();
            foreach (ZipReader.ZipEntryFull entry in _zippy.Entries)
            {
                Files.Add(entry.Filename);
            }

            _trees = new List <HashTree>();
            try { _trees.Add(new HashTree(Path.Combine(treefolder, "ME1Tree.hash"))); }
            catch (FileNotFoundException) { }
            try { _trees.Add(new HashTree(Path.Combine(treefolder, "ME2Tree.hash"))); }
            catch (FileNotFoundException) { }
            try { _trees.Add(new HashTree(Path.Combine(treefolder, "ME3Tree.hash"))); }
            catch (FileNotFoundException) { }

            _formview = FormView;
            if (_formview)
            {
                if (_trees.Count < 3)
                {
                    MessageBox.Show("Some of the hash files weren't found, some of the auto-matching options won't be available", "Missing files", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                TPFView form = new TPFView(this);
                form.Show();
            }
        }
Example #2
0
        /// <summary>
        /// Class Constructor
        /// </summary>
        /// <param name="file">The full path to the TPF file for reading</param>
        /// <param name="treefolder">The path to the directory containing the hash tree files</param>
        /// <param name="FormView">Should the class generate a form to view this TPF</param>
        public TPFExtract(String file, String treefolder, bool FormView)
        {
            _zippy = new ZipReader(file);

            Files = new List<string>();
            foreach (ZipReader.ZipEntryFull entry in _zippy.Entries)
                Files.Add(entry.Filename);

            _trees = new List<HashTree>();
            try { _trees.Add(new HashTree(Path.Combine(treefolder, "ME1Tree.hash"))); }
            catch (FileNotFoundException) { }
            try { _trees.Add(new HashTree(Path.Combine(treefolder, "ME2Tree.hash"))); }
            catch (FileNotFoundException) { }
            try { _trees.Add(new HashTree(Path.Combine(treefolder, "ME3Tree.hash"))); }
            catch (FileNotFoundException) { }

            _formview = FormView;
            if (_formview)
            {
                if (_trees.Count < 3)
                    MessageBox.Show("Some of the hash files weren't found, some of the auto-matching options won't be available", "Missing files", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                TPFView form = new TPFView(this);
                form.Show();
            }
        }