/// <summary> /// 画面で設定した内容を、対象のOcrSettingオブジェクトに戻す。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveSettingButton_Click(object sender, EventArgs e) { OcrSetting targetOcrSettiong; int targetIndex; switch (SelectOcrSettingListBox.SelectedIndex) { case LIST_INDEX_OCR_TITLE: // Title targetOcrSettiong = setting.defaultBndrOcrSetting.TitleOcrSetting; break; case LIST_INDEX_OCR_DIFFICULT: //Difficult targetOcrSettiong = setting.defaultBndrOcrSetting.DifficultOcrSetting; break; case LIST_INDEX_OCR_MAX_COMBO: // Max combo targetOcrSettiong = setting.defaultBndrOcrSetting.MaxComboOcrSetting; break; case LIST_INDEX_OCR_RESULT_NOTES: // Result notes targetOcrSettiong = setting.defaultBndrOcrSetting.ResultNotesOcrSetting; break; case LIST_INDEX_OCR_LEVEL: // Level targetOcrSettiong = setting.defaultBndrOcrSetting.LevelOcrSetting; break; case LIST_INDEX_OCR_SCORE: // Score targetOcrSettiong = setting.defaultBndrOcrSetting.ScoreOcrSetting; break; default: // Default targetOcrSettiong = new OcrSetting(); break; } targetOcrSettiong.positionX = (int)PositionXNumericUpDown.Value; targetOcrSettiong.positionY = (int)PositionYNumericUpDown.Value; targetOcrSettiong.width = (int)WidthNumericUpDown.Value; targetOcrSettiong.height = (int)HeightNumericUpDown.Value; // Apply to control ChangeApplyToSelectOcrSettingListBox(); }
/// <summary> /// SettingOcrSelectListBoxを選択した際、対応する内容を画面に設定する。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoadSettingButton_Click(object sender, EventArgs e) { OcrSetting targetOcrSettiong; switch (SelectOcrSettingListBox.SelectedIndex) { case LIST_INDEX_OCR_TITLE: // Title targetOcrSettiong = setting.defaultBndrOcrSetting.TitleOcrSetting; break; case LIST_INDEX_OCR_DIFFICULT: //Difficult targetOcrSettiong = setting.defaultBndrOcrSetting.DifficultOcrSetting; break; case LIST_INDEX_OCR_MAX_COMBO: // Max combo targetOcrSettiong = setting.defaultBndrOcrSetting.MaxComboOcrSetting; break; case LIST_INDEX_OCR_RESULT_NOTES: // Result notes targetOcrSettiong = setting.defaultBndrOcrSetting.ResultNotesOcrSetting; break; case LIST_INDEX_OCR_LEVEL: // Level targetOcrSettiong = setting.defaultBndrOcrSetting.LevelOcrSetting; break; case LIST_INDEX_OCR_SCORE: // Score targetOcrSettiong = setting.defaultBndrOcrSetting.ScoreOcrSetting; break; default: // Default targetOcrSettiong = new OcrSetting(); break; } PositionXNumericUpDown.Value = targetOcrSettiong.positionX; PositionYNumericUpDown.Value = targetOcrSettiong.positionY; WidthNumericUpDown.Value = targetOcrSettiong.width; HeightNumericUpDown.Value = targetOcrSettiong.height; }