示例#1
0
        // ---

        #region Extraction
        protected void ExtractDataFiles(DataRep g, string tmpPath)
        {
            string fileExt = Path.GetExtension(g.CurrentPath).TrimStart('.');

            // Détection du mode
            if (fileExt.Equals("zip", StringComparison.OrdinalIgnoreCase))
            {
                // Extraction des fichiers
                ZipDecompression zippy = new ZipDecompression()
                {
                    TokenSource = this.TokenSource,
                    IsPaused    = this.IsPaused,
                };
                zippy.ExtractSpecificFiles(g.CurrentPath, tmpPath, "DPGame.json", "NBGame.xml", "TBGame.xml", "EBGame.xml");
            }

            else if (fileExt.Equals("7zip", StringComparison.OrdinalIgnoreCase) || fileExt.Equals("7z", StringComparison.OrdinalIgnoreCase))
            {
                // Extraction des fichiers
                SevenZipDecompression sevZipp = new SevenZipDecompression()
                {
                    TokenSource = this.TokenSource,
                    IsPaused    = this.IsPaused,
                };
                sevZipp.ExtractSpecificFiles(g.CurrentPath, tmpPath, "DPGame.json", "NBGame.xml", "TBGame.xml", "EBGame.xml");
            }
            else
            {
                throw new Exception("File format not managed");
            }
        }
示例#2
0
        void DPGZipCore(DataRep archive, string gamePath)
        {
            // Extraction des fichiers xml
            ZipDecompression zippy = new ZipDecompression()
            {
                TokenSource = this.TokenSource,
                IsPaused    = this.IsPaused,
            };


            SafeBoxes.LaunchDouble(zippy, () => zippy.ExtractSpecificFiles(archive.CurrentPath, gamePath,
                                                                           "NBGame.xml", "TBGame.xml", "EBGame.xml", "DPGame.json"),
                                   "Zip Extraction");

            /*var res = PackMe_IHM.ZipCompressFolder(zippy, () => zippy.CompressFolder(
             *                           gamePath, title, PS.Default.cZipCompLvl), "Compression Zip");*/
        }