public static PaperForm getInstance(ClosePaper ClosePaper) { if (instance == null) { instance = new PaperForm(ClosePaper); } instance.Show(); return(instance); }
private void SelProblem(OneProblemForm oneProblemForm, ProblemWithTypeName problemWithTN, bool IsBtn) { //if (this.CurSelProblemWithTN != problemWithTN) //{ // this.CurSelProblemWithTN = problemWithTN; // this.tbProblemType.Text = this.CurSelProblemWithTN.TypeName; // this.rtbProblemOther.Text = this.CurSelProblemWithTN.Other; //} if (CurSelProblemForm != oneProblemForm) { if (CurSelProblemForm != null) { CurSelProblemForm.CancelFocus(); } CurSelProblemForm = oneProblemForm; CurSelProblemForm.SetFocus(); this.CurSelProblemWithTN = CurSelProblemForm.cuProblemWithTN; this.tbProblemType.Text = this.CurSelProblemWithTN.TypeName; this.rtbProblemOther.Text = this.CurSelProblemWithTN.Other; } if (IsBtn) { //MessageBox.Show("添加到试卷"); if (this.IKnowltAndProblemFormReq.InsertOneProblem(this.CurSelProblemWithTN) == 1) { if (this.varClosePaper == null) { this.varClosePaper = new ClosePaper(this.ClosePaper); } PaperForm.getInstance(this.varClosePaper).AddChild(new ProblemInPaper(this.CurSelProblemWithTN)); } } this.ShowAnswer(); }
private PaperForm(ClosePaper ClosePaper) { InitializeComponent(); this.ClosePaper = ClosePaper; }