Пример #1
0
        private static void SplitFiles(FileSplitter fs, string operation)
        {
            Thread t = new Thread(new ParameterizedThreadStart(SplitThread));

            t.SetApartmentState(ApartmentState.STA);
            using (WaitDlg dlg = new WaitDlg(operation))
            {
                dlg.UpdateStatus("Please wait while files are being extracted and imaged");
                SplitThreadParams stp = new SplitThreadParams(fs, dlg);
                t.Start(stp);
                dlg.ShowDialog();
            }
        }
Пример #2
0
        private void recompressFiles_Click(object sender, EventArgs e)
        {
            string inDir  = @"C:\Users\Adrian\Downloads\GT2\US1.0Vol\USBmpTest";
            string outDir = @"C:\Users\Adrian\Downloads\GT2\US1.0Vol\USBmpTestMod";

            using (WaitDlg dlg = new WaitDlg("Checking GM Files"))
            {
                RecompressThreadArgs rta = new RecompressThreadArgs();
                rta.dlg    = dlg;
                rta.inDir  = inDir;
                rta.outDir = outDir;
                System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(RecompressGMFiles), rta);
                dlg.ShowDialog(this);
            }
        }
Пример #3
0
        void checkGameFileValidity_Click(object sender, EventArgs e)
        {
            //string dir = PickFolder(this, "Open dir with GM files");
            string dir = @"T:\gt2\gtmenu\pics\GTMenuDatDecomp";

            if (!String.IsNullOrEmpty(dir))
            {
                using (WaitDlg dlg = new WaitDlg("Checking GM Files"))
                {
                    ValidityThreadArgs vta = new ValidityThreadArgs();
                    vta.dlg = dlg;
                    vta.dir = dir;
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(CheckGMFileValidity), vta);
                    dlg.ShowDialog(this);
                }
            }
        }
Пример #4
0
 private static void MergeFiles(List <string> inFiles, string outFile, string operation, int compression, int fileAlignment, IWin32Window parent)
 {
     if (inFiles.Count <= 1)
     {
         MainForm.DisplayMsgBox(MessageBoxButtons.OK, MessageBoxIcon.Error, "Directory contains only one or no files to merge");
         return;
     }
     using (WaitDlg dlg = new WaitDlg(operation))
     {
         dlg.UpdateStatus("Please wait while files are being merged and compressed");
         Thread mergeThread = new Thread(new ParameterizedThreadStart(MergeThread));
         mergeThread.SetApartmentState(ApartmentState.STA);
         MergeThreadParams mtp = new MergeThreadParams(dlg, inFiles, outFile, compression, fileAlignment);
         mergeThread.Start(mtp);
         dlg.ShowDialog(parent);
     }
 }