Ejemplo n.º 1
0
        /**
         * Handles the target migration change event.
         */
        public static void TargetMigrationChangeHandler()
        {
            SimulatorOption simOption;

            if (!ignoreTargetMigrationChange)
            {
                MigrationComboFunctions.FillTargetMigrationComboOptions();

                simOption = SimulatorOptions.GetOptionBySelectedItem(MainForm.GetMigrateTargetCombo());
                SettingsHandler.SetSetting("migrationTarget", simOption.GetValue().ToString());
            }

            simOption = SimulatorOptions.GetOptionBySelectedItem(MainForm.GetMigrateTargetCombo());
            selectedTargetSimulator = simOption;
        }
Ejemplo n.º 2
0
        /**
         * Handles the main form's load functionality.
         */
        public static void OnLoadHandler()
        {
            CloseIfAlreadyRunning();

            MigrationComboFunctions.FillSourceMigrationComboOptions();
            MigrationComboFunctions.FillTargetMigrationComboOptions();

            //If the settings exist, we initialize the selected options from the settings
            string migrationSourceVal = SettingsHandler.GetSetting("migrationSource");
            string migrationTargetVal = SettingsHandler.GetSetting("migrationTarget");

            if (!migrationSourceVal.Equals(""))
            {
                SimulatorOptions.SetSelectedOptionByVal(MainForm.GetMigrateSourceCombo(), Int32.Parse(migrationSourceVal));
            }

            if (!migrationTargetVal.Equals(""))
            {
                SimulatorOptions.SetSelectedOptionByVal(MainForm.GetMigrateTargetCombo(), Int32.Parse(migrationTargetVal));
            }

            string isStarted = SettingsHandler.GetSetting("started");
            string autoStart = SettingsHandler.GetSetting("autoStart");

            //Initializes the listeners if the auto start option is available and the migration is in started mode.
            if (isStarted.Equals("1") && autoStart.Equals("1"))
            {
                startMigrateButton.Text = STOP_MIGRATION_TEXT;

                DisableMigrationCombos();
                FileListeners.InitStaticListeners();
            }
            else
            {
                SettingsHandler.SetSetting("started", "0");
                FilesHandler.RestoreSourceConfigFiles(GetSelectedSourceSimulator()); //Restores the source config files if exist
            }

            InitializeDefaultSettings();
        }