Exemplo n.º 1
0
        public void Uncompress(string docxFile, string directory, bool desactivateXmlFormat = false)
        {
            // - case 1 : extract all files in directory with directory structure
            if (zDirectory.Exists(directory))
            {
                directory = zdir.GetNewDirectory(directory);
            }
            //Action<string> doAfterUncompress = null;
            //if (!desactivateXmlFormat)
            //    doAfterUncompress = FormatXmlFile;
            IEnumerable <string> files = _compressManager.Uncompress(docxFile, directory, uncompressOptions: UncompressOptions.ExtractFullPath);

            if (!desactivateXmlFormat)
            {
                FormatXmlFiles(files);
            }
        }
Exemplo n.º 2
0
        public static void Test_CompressManager_01(string file, string directory = null, UncompressOptions options = UncompressOptions.None)
        {
            Trace.WriteLine("Uncompress file \"{0}\" in \"{1}\"", file, directory);
            Trace.WriteLine("options {0}", options);
            CompressManager  compressManager = new CompressManager();
            UncompressResult result          = compressManager.Uncompress(file, directory, options);

            //Trace.WriteLine("Uncompress files :");
            //foreach (string file2 in result.UncompressFiles)
            //    Trace.WriteLine("  \"{0}\"", file2);
            //Trace.WriteLine("Compress files :");
            //foreach (string file2 in result.CompressFiles)
            //    Trace.WriteLine("  \"{0}\"", file2);
            Trace.WriteLine("result :");
            Trace.WriteLine(result.zToJson());
        }