Exemplo n.º 1
0
 public void startTableCopy()
 {
     try
     {
         frmFileSelection frmF = new frmFileSelection();
         frmF.btnOK.Text = "Select files";
         frmF.Text       = "Select target for tables";
         frmF.LoadFiles(UniversalPatcher.Properties.Settings.Default.LastBINfolder);
         if (frmF.ShowDialog(this) == DialogResult.OK)
         {
             pcmList = new List <SelectPCM>();
             for (int i = 0; i < frmF.listFiles.CheckedItems.Count; i++)
             {
                 string  fileName = frmF.listFiles.CheckedItems[i].Tag.ToString();
                 PcmFile newPCM   = new PcmFile(fileName, true, "");
                 LoggerBold(fileName);
                 newPCM.loadTunerConfig();
                 if (PCM.seekTablesImported && !newPCM.seekTablesImported)
                 {
                     newPCM.importSeekTables();
                 }
                 SelectPCM sPCM = new SelectPCM();
                 sPCM.pcmFile = newPCM;
                 searchTargetTables(sPCM.pcmFile, tableIds, false);
                 pcmList.Add(sPCM);
             }
             LoggerBold("Select destination files and Press Apply to copy tables");
             refreshPcmList();
         }
     }
     catch (Exception ex)
     {
         LoggerBold(ex.Message);
     }
 }
Exemplo n.º 2
0
        public void selectCmpFiles()
        {
            if (!compareAll)
            {
                splitContainer1.Panel1Collapsed = true;
                splitContainer1.Panel1.Hide();
            }
            frmFileSelection frmF = new frmFileSelection();

            frmF.btnOK.Text = "Compare files";
            frmF.Text       = "Search and Compare: " + td.TableName;
            frmF.LoadFiles(UniversalPatcher.Properties.Settings.Default.LastBINfolder);
            if (frmF.ShowDialog(this) == DialogResult.OK)
            {
                if (compareAll)
                {
                    List <string> files = new List <string>();
                    for (int i = 0; i < frmF.listFiles.CheckedItems.Count; i++)
                    {
                        string FileName = frmF.listFiles.CheckedItems[i].Tag.ToString();
                        files.Add(FileName);
                    }
                    initCompareAll();
                    compareAllTables(files);
                }
                else
                {
                    for (int i = 0; i < frmF.listFiles.CheckedItems.Count; i++)
                    {
                        string  FileName = frmF.listFiles.CheckedItems[i].Tag.ToString();
                        PcmFile cmpPcm   = new PcmFile(FileName, true, "");
                        LoggerBold(FileName);
                        loadConfigforPCM(cmpPcm);
                        compareTable(cmpPcm);
                    }
                }
            }
            dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
            Logger("Done");
        }