public UIElement Visit(Evaluation.Values.Int value) { CustomTextBox customTextBox = new CustomTextBox(new IntHandler()) { Name = uiElementId, Text = value.GetValue().ToString(), IsReadOnly = isReadOnly }; customTextBox.EventUpdateValue += UpdateValue; return(customTextBox); }
public void Evaluate_Multiply_Test() { Expression left = CreateIntLiteral(2); Expression right = CreateIntLiteral(2); Expression multiply = new Multiply(left, right, pos); Values.Int value = ((Values.Int)multiply.Accept(evaluator)); Assert.IsTrue(value.GetValue() == 4); }
public void Evaluate_Divide_Test() { Expression left = CreateIntLiteral(4); Expression right = CreateIntLiteral(2); Expression divide = new Divide(left, right, pos); Values.Int value = ((Values.Int)divide.Accept(evaluator)); Assert.IsTrue(value.GetValue() == 2); }
public void Evaluate_Substract_Negative_Test() { Expression left = CreateIntLiteral(1); Expression right = CreateIntLiteral(2); Expression substract = new Subtract(left, right, pos); Values.Int value = ((Values.Int)substract.Accept(evaluator)); Assert.IsTrue(value.GetValue() == -1); }
public void Evaluate_Add_Test() { Expression left = CreateIntLiteral(1); Expression right = CreateIntLiteral(1); Expression add = new Add(left, right, pos); Values.Int value = ((Values.Int)add.Accept(evaluator)); Assert.IsTrue(value.GetValue() == 2); }
public StackPanel Visit(Values.Int value) { throw new ArgumentException("StackPanel cannot be created using Evaluation.Values.Int"); }