示例#1
0
        public void Unpack()
        {
            Clean();
            string tacFilename     = Path.GetFileName(TADFile.Filename).ToLower().Replace(".tad", ".tac");
            string tacPath         = Path.GetDirectoryName(TADFile.Filename) + "\\" + tacFilename;
            string targetDirectory = Path.GetDirectoryName(tacPath) + "\\" + "_" + tacFilename + "_";

            Header.RelativeOutputFolder = "\\" + Helper.GetRelativePath(targetDirectory, Path.GetDirectoryName(tacPath));
            Header.RelativeTACPath      = "\\" + Helper.GetRelativePath(tacPath, Path.GetDirectoryName(tacPath));
            Header.RelativeTADPath      = "\\" + Helper.GetRelativePath(TADFile.Filename, Path.GetDirectoryName(tacPath));

            TACFile       tacFile       = new TACFile();
            LoadingDialog loadingDialog = new LoadingDialog();

            loadingDialog.SetData(tacFile);
            Thread thread = new Thread(delegate() {
                tacFile.Unpack(tacPath, targetDirectory, TADFile);
            });

            loadingDialog.ShowDialog(thread);

            string cachePath = Path.GetDirectoryName(tacPath) + "\\" + Path.GetFileName(TADFile.Filename).ToLower().Replace(".tad", ".cache");

            Filename = cachePath;
            Write(cachePath);
        }
示例#2
0
        public void Export(string tadFilename, bool exportModified = true)
        {
            string tacPath     = Path.GetDirectoryName(tadFilename) + "\\" + Path.GetFileName(tadFilename).ToLower().Replace(".tad", ".tac");
            string inputFolder = Path.GetDirectoryName(Filename) + Header.RelativeOutputFolder;

            if (exportModified)
            {
                LoadingDialog loadingDialogHash = new LoadingDialog();
                loadingDialogHash.SetData(this);
                Thread threadHash = new Thread(delegate()
                {
                    CalculateHashes();
                });
                loadingDialogHash.ShowDialog(threadHash);
            }

            TACFile       tacFile       = new TACFile();
            LoadingDialog loadingDialog = new LoadingDialog();

            loadingDialog.SetData(tacFile);
            Thread thread = new Thread(delegate() {
                tacFile.Pack(tacPath, inputFolder, TADFile);
            });

            loadingDialog.ShowDialog(thread);

            TADFile.Write(tadFilename);
        }
示例#3
0
        public void Pack()
        {
            string tacPath     = Path.GetDirectoryName(Filename) + Header.RelativeTACPath;
            string inputFolder = Path.GetDirectoryName(Filename) + Header.RelativeOutputFolder;

            TACFile       tacFile       = new TACFile();
            LoadingDialog loadingDialog = new LoadingDialog();

            loadingDialog.SetData(tacFile);
            Thread thread = new Thread(delegate() {
                tacFile.Pack(tacPath, inputFolder, TADFile, false);
            });

            loadingDialog.ShowDialog(thread);

            string cachePath = Path.GetDirectoryName(tacPath) + "\\" + Path.GetFileName(TADFile.Filename).ToLower().Replace(".tad", ".cache");

            Filename = cachePath;
            Write(cachePath);
        }