public void EditAnalysis(AnalysisHetero analysis) { // search for DockContentHAnalysis window and close it var seq = (from view in Views where view is DockContentHAnalysisCasePallet && (analysis == (view as DockContentHAnalysisCasePallet).Analysis) select view); if (seq.Count() > 0) { seq.First().Close(); } // instantiate a form to edit analysis Form form = null; if (analysis is HAnalysisPallet) { form = new FormNewHAnalysisCasePallet(this, analysis); } else if (analysis is HAnalysisTruck) { form = new FormNewHAnalysisCaseTruck(this, analysis); } else { MessageBox.Show("Unexpected analysis type!"); return; } if (DialogResult.OK == form.ShowDialog()) { } }
public void CreateNewHAnalysisTruckUI() { if (!CanCreateAnalysisCaseTruck) { return; } using (FormNewHAnalysis form = new FormNewHAnalysisCaseTruck(this, null)) if (DialogResult.OK == form.ShowDialog()) { } }