//static bool Tmp = false; static public void Setup(string name, SimpleFormula formula, MethodSimple ms, SpectrView spv, int element_index, int formula_index) { try { if (Dlg == null || Dlg.IsDisposed) { Dlg = new SimpleFormulaEditor(); } else if (CheckSave() == false) { return; } ElementIndex = element_index; FormulaIndex = formula_index; CurrentFormula = null; if (element_index >= 0 && formula_index >= 0) { Dlg.simpleFormula.InitBy(formula, element_index, formula_index); } CurrentFormula = formula; spv.ClearAnalitMarkers(); Dlg.simpleFormula.Element = formula.Element; Dlg.simpleFormula.SetupSpectrView(spv); Dlg.Text = name + " " + formula.Name; //Dlg.Show(); } catch (Exception ex) { Common.Log(ex); } }
private void SimpleFormulaEditor_FormClosing(object sender, FormClosingEventArgs e) { try { simpleFormula.VisibleChangedProc(false); if (CheckSave() == false) { e.Cancel = false; return; } //Dlg = null; CurrentFormula = null; Dlg.Visible = false; e.Cancel = true; } catch (Exception ex) { Common.Log(ex); } }
public void initBy(MethodSimple method, SimpleFormula formula) { this.formula = formula; this.method = method; init(); }