private void swichSection(FactorControl section) { if (hypothesisControl != null) { this.hypothesisControl.Dispose(); this.hypothesisControl = null; } if (activeFactor != null) { this.activeFactor.Dispose(); } this.activeFactor = section; this.panelSectionContent.Controls.Add(section); }
private void buttonHypothesis_Click(object sender, EventArgs e) { if (activeFactor != null) { activeFactor.Dispose(); activeFactor = null; } if (hypothesisControl == null) { if (this.viewModel.survey.hypotheses == null) { this.viewModel.survey.hypotheses = new List <Hypothesis>(); } this.hypothesisControl = new HypothesisControl(this.viewModel.survey.hypotheses, this.viewModel.survey.factors); this.hypothesisControl.Dock = DockStyle.Fill; this.hypothesisControl.AutoScaleMode = AutoScaleMode.None; this.hypothesisControl.Show(); this.panelSectionContent.Controls.Add(hypothesisControl); } }