コード例 #1
0
 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;
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: xuchuansheng/GenXSource
		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;
			}
		}