Exemple #1
0
 private void CalculatorForm_Load(object sender, EventArgs e)
 {
     es                        = new ExpressionScanner();
     ed                        = new ExpressionDisplayer(es);
     es.NumInputed            += Es_NumInputed;
     es.NewNumDiscovered      += Es_NewNumDiscovered;
     es.NewOperatorDiscovered += Es_NewOperatorDiscovered;
     calc                      = new Calculator();
     calc.AfterCalculation    += Calc_AfterCalculation;
     ed.ExpressionChanged     += Ed_ExpressionChanged;
     ed.ResultProvider         = () => calc.CurrentNumbers[0];
 }
 public ExpressionDisplayer(ExpressionScanner es)
 {
     this.es                   = es;
     es.NewNumDiscovered      += Es_NewNumDiscovered;
     es.NewOperatorDiscovered += Es_NewOperatorDiscovered;
 }