private void importthread()
        {
            BackupSettingsExportImport newimport = new BackupSettingsExportImport();

            if (newimport != null)
            {
                newimport.ExportImportInit(ref progressBar, false);
                newimport.newmessage += new textexportmessage(textoutput);

                newimport.MyLoadSettings();
                newimport.getallversionnumbers("", false); //get only program version numbers after loadsettings
                newimport.Status = Status;
                bool ok = newimport.restorebackup(filenametextBox.Text);
                if (ok)
                    MessageBox.Show(this, "Import completed successfully");
                else
                {
                    if (PB_th != null)
                    {
                        newimport.ProgressbarCancel();
                    }
                    MessageBox.Show(this, "Import not successful - Check the status and the log file");
                }
                newimport.MySaveSettings();
                newimport.newmessage -= new textexportmessage(textoutput);
            }

            textoutput("\n");  //create new paragraph after completed export
            BUSY = false; //job completed
        }
Esempio n. 2
0
        private void importthread()
        {
            BackupSettingsExportImport newimport = new BackupSettingsExportImport();

            if (newimport != null)
            {
                newimport.newmessage += new textexportmessage(textoutput);
                newimport.ExportImport(ref progressBar, CONFIG_FILE);

                newimport.MyLoadSettings();
                newimport.getallversionnumbers("", false); //get only program version numbers after loadsettings
                bool ok = newimport.restorebackup(filenametextBox.Text);
                if (ok)
                    MessageBox.Show(this, "Import completed successfully");
                else
                {
                    if (PB_th != null)
                    {
                        newimport.ProgressbarCancel();
                    }
                    MessageBox.Show(this, "Import not successful - Check the status and the log file");
                }
                newimport.MySaveSettings();
                newimport.newmessage -= new textexportmessage(textoutput);
            }

            textoutput("\n");  //create new paragraph after completed export
            BUSY = false; //job completed

            /*
            bool ok = newexportimport.restorebackup(filenametextBox.Text);
            if (ok)
                MessageBox.Show("Import completed successfully", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            else
            {
                if (PB_th != null)
                {
                    newexportimport.progressbar((int)PB_action.CANCEL, ref PB_Import, PB_action_number);
                }
                MessageBox.Show(this, "Import not successful - Check the status and the log file");
            }

            //MyLoadSettings();  // reload plugin settings after import
            textoutput("\n");  //create new paragraph after completed import
            BUSY = false; //reset processing flag   */
        }