Beispiel #1
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);
        }
Beispiel #2
0
 public void Write(string filename)
 {
     if (!Helper.IsFileValid(filename, false))
     {
         return;
     }
     using (FileStream stream = File.Create(filename))
     {
         using (BinaryWriter writer = new BinaryWriter(stream))
         {
             Header.Write(writer);
             TADFile.Write(writer, true);
         }
     }
 }