Exemple #1
0
        /// <summary>
        /// Calculates the result and updates the result textbox
        /// </summary>
        private void UpdateResult()
        {
            Context     currentContext    = null;
            IExpression currentExpression = null;

            if (ExpressionReader.ReadExpression(expression, ref currentExpression, ref currentContext))
            {
                txt_Result.Text = currentExpression.Interpret(currentContext).ToString(CultureInfo.CurrentCulture);
            }
            else
            {
                txt_Result.Text = "Expression invalid!";
            }
        }