コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public StackPanel Visit(Values.Int value)
 {
     throw new ArgumentException("StackPanel cannot be created using Evaluation.Values.Int");
 }