Beispiel #1
0
 private void button_Convert_Click(object sender, EventArgs e)
 {
     if (StageParamLoaded())
     {
         if (OutputCheck())
         {
             if (Directory.Exists(textBox_Data.Text) ||
                 File.Exists(textBox_FileBGM.Text) ||
                 File.Exists(textBox_FileSHOT.Text))
             {
                 if (comboBox_Mode.SelectedIndex == 0)
                 {
                     if (comboBox_SystemStageParam.SelectedIndex == 2)
                     {
                         AC_to_SWITCH converter = new AC_to_SWITCH();
                         converter.Conversion(false, true);
                     }
                     else
                     {
                         AC_to_AC converter = new AC_to_AC();
                         converter.Conversion(false, true);
                     }
                 }
                 else if (comboBox_Mode.SelectedIndex == 1)
                 {
                     MOBILE_to_SWITCH mobiletoswitch = new MOBILE_to_SWITCH();
                     mobiletoswitch.Conversion(false, true);
                 }
             }
             else
             {
                 MessageHandler.ShowError(1);
             }
         }
     }
 }
Beispiel #2
0
        public void button_ConvertUpdate_Click(object sender, EventArgs e)
        {
            bool mode_updater   = true;
            bool mode_converter = true;
            bool functionStart  = false;

            all = false;

            if (StageParamLoaded() || sender == button_Convert)
            {
                if (OutputCheck())
                {
                    if (sender == button_ConvertALL)
                    {
                        all = true;
                    }
                    else if (sender == button_Convert)
                    {
                        mode_updater = false;
                    }
                    else if (sender == button_Update)
                    {
                        mode_converter = false;
                    }


                    if (comboBox_Mode.SelectedIndex == 0)
                    {
                        if (Directory.Exists(textBox_Data.Text) ||
                            File.Exists(textBox_FileBGM.Text) ||
                            File.Exists(textBox_FileSHOT.Text))
                        {
                            if (comboBox_SystemStageParam.SelectedIndex == 2)
                            {
                                functionStart = true;
                                AC_to_SWITCH converter = new AC_to_SWITCH();
                                converter.Conversion(mode_updater, true, comboBox_SystemStageParam.SelectedIndex);
                            }
                            else if (comboBox_SystemStageParam.SelectedIndex == 0 ||
                                     comboBox_SystemStageParam.SelectedIndex == 1)
                            {
                                functionStart = true;
                                AC_to_AC converter = new AC_to_AC();
                                converter.Conversion(mode_updater, true, comboBox_SystemStageParam.SelectedIndex);
                            }
                            else if (!functionStart)
                            {
                                MessageHandler.ShowWarning(7);
                            }
                        }
                        else
                        {
                            MessageHandler.ShowError(1);
                            functionStart = true;
                        }
                    }
                    if (comboBox_Mode.SelectedIndex == 1 && comboBox_SystemStageParam.SelectedIndex == 2)
                    {
                        if (Directory.Exists(textBox_Data.Text) ||
                            File.Exists(textBox_FileBGM.Text) ||
                            File.Exists(textBox_FileSHOT.Text))
                        {
                            functionStart = true;
                            MOBILE_to_SWITCH converter = new MOBILE_to_SWITCH();
                            if (sender.Equals(button_onlyStageParam))
                            {
                                converter.Conversion(mode_updater, true, true);
                            }
                            else
                            {
                                converter.Conversion(mode_updater, true);
                            }
                        }
                        else
                        {
                            MessageHandler.ShowError(1);
                            functionStart = true;
                        }
                    }
                    else if (!functionStart)
                    {
                        MessageHandler.ShowWarning(7);
                    }
                }
            }
            else
            {
                MessageHandler.ShowError(0);
            }


            if (Args.convert)
            {
                Application.Exit();
            }
        }