private void btnEvaluate3_Click(object sender, System.EventArgs e) { try { // I am not a C# specialist... is that the right way of doing this? if (FormulaHandler != null) { mFormula3.ValueChanged -= FormulaHandler; } mFormula3 = ev.Parse(tbExpression3.Text); FormulaHandler = new Eval3.iEvalValue.ValueChangedEventHandler(mFormula3_ValueChanged); mFormula3.ValueChanged += FormulaHandler; mFormula3_ValueChanged(null, null); } catch (Exception ex) { lblResults3.Text = ex.Message; } }
private void btnEvaluate3_Click(object sender, System.EventArgs e) { try { // I am not a C# specialist... is that the right way of doing this? if (FormulaHandler!=null) mFormula3.ValueChanged -= FormulaHandler; mFormula3 = ev.Parse(tbExpression3.Text); FormulaHandler = new Eval3.iEvalValue.ValueChangedEventHandler(mFormula3_ValueChanged); mFormula3.ValueChanged += FormulaHandler; mFormula3_ValueChanged(null, null); } catch(Exception ex) { lblResults3.Text = ex.Message; } }