private void 過去に作成した問題を全てクリアするCToolStripMenuItem_Click(object sender, EventArgs e) { if (HistoryDataUtils.getHistories().Length == 0) { MessageBox.Show( "過去に作成した問題はありません。", "続行できません", MessageBoxButtons.OK, MessageBoxIcon.Warning ); return; } if (MessageBox.Show( "過去に作成した問題を全てクリアします。\n宜しいですか?", "確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning ) == DialogResult.OK ) { HistoryDataUtils.clearHistories(); MessageBox.Show( "クリアしました。", "情報", MessageBoxButtons.OK, MessageBoxIcon.Information ); } }
private void btnMkAndPrint_Click(object sender, EventArgs e) { ProblemInfo pi = Gnd.i.problemInfos[lbKind.SelectedIndex]; int level = cmbDifficulty.SelectedIndex; Gnd.i.mkAndPrintWinParentWin = this; Gnd.i.mkSudokuProc = new MkSudokuProc(pi, level); using (MkAndPrintWin f = new MkAndPrintWin(pi, level)) { f.ShowDialog(); } if (Gnd.i.mkSudokuProc.isEnded() == false) { CancellableBusyDlg.perform(true, delegate { Gnd.i.cancellableBusyDlg.setTitle("問題作成プロセスを停止しています..."); Gnd.i.mkSudokuProc.bCancel(); }); } Gnd.i.mkSudokuProc.Dispose(); Gnd.i.mkSudokuProc = null; Gnd.i.mkAndPrintWinParentWin = null; HistoryDataUtils.trimHistories(); GC.Collect(); }
private void HistoryWin_Shown(object sender, EventArgs e) { mainSheet_init(); { HistoryData[] histories = HistoryDataUtils.getHistories(); mainSheet.RowCount = histories.Length; for (int index = 0; index < histories.Length; index++) { mainSheet_setRow(index, histories[index]); } mainSheet.Rows[0].Selected = true; } }
public HistoryData getResult() { if (_result == null) { if (_proc != null) { throw null; } string inputCsvFile = Path.Combine(_inputDataDir, "Input.csv"); string outputCsvFile = Path.Combine(_inputDataDir, "Output.csv"); { string file = Path.Combine(_inputDataDir, "InstantDrawingScript.txt"); if (File.Exists(file)) { Gnd.i.instantDrawingScriptFile = file; } } Bitmap imgProblem = new ImageCreator( _pi, Utils.levelToDigitColor(_level), inputCsvFile ) .getImage(); Bitmap imgAnswer = new ImageCreator( _pi, Gnd.i.ansColor, outputCsvFile, new ImageCreator.Surface() { digitColor = Utils.levelToDigitColor(_level), csvFile = inputCsvFile, } ) .getImage(); Gnd.i.instantDrawingScriptFile = null; _result = HistoryDataUtils.createHistory(_pi, _level, imgProblem, imgAnswer); } return(_result); }
private void 履歴RToolStripMenuItem_Click(object sender, EventArgs e) { if (HistoryDataUtils.getHistories().Length == 0) { MessageBox.Show( "過去に作成した問題はありません。", "続行できません", MessageBoxButtons.OK, MessageBoxIcon.Warning ); return; } this.Visible = false; using (HistoryWin f = new HistoryWin()) { f.ShowDialog(); } this.Visible = true; // restore GC.Collect(); }