예제 #1
0
        /// <summary>
        ///     参照ボタン押下時の処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnBrowseButtonClick(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            if (dialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            pathTextBox.Text = dialog.FileName;
            // 自動判別処理
            if (typeComboBox.SelectedIndex == 0)
            {
                PatchController.DetectGameType(pathTextBox.Text);
                typeComboBox.SelectedIndex = PatchController.GetGameIndex();
            }
            // 自動処理モード
            if (PatchController.AutoMode)
            {
                saveButton.Enabled = PatchController.AutoProcess();
            }
        }
예제 #2
0
        /// <summary>
        ///     ファイルをドロップした時の処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnFormDragDrop(object sender, DragEventArgs e)
        {
            string fileName = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0];

            // フォルダをドロップした場合はその下の実行ファイルを対象とする
            if (Directory.Exists(fileName))
            {
                fileName = PatchController.DetectExeFileName(fileName);
            }
            pathTextBox.Text = fileName;
            // 自動判別処理
            if (typeComboBox.SelectedIndex == 0)
            {
                PatchController.DetectGameType(pathTextBox.Text);
                typeComboBox.SelectedIndex = PatchController.GetGameIndex();
            }
            // 自動処理モード
            if (PatchController.AutoMode)
            {
                saveButton.Enabled = PatchController.AutoProcess();
            }
        }