예제 #1
0
        public override void Interpret(IContext context)
        {
            ExpressionA.Interpret(context);
            ExpressionB.Interpret(context);
            var result = context.Get(ExpressionA).Equals(context.Get(ExpressionB));

            context.AddVariable(this, result);
        }
예제 #2
0
        public override void Interpret(IContext context)
        {
            ExpressionA.Interpret(context);
            ExpressionB.Interpret(context);
            var result = (bool)context.Get(ExpressionA) || (bool)context.Get(ExpressionB);

            context.AddVariable(this, result);
        }
예제 #3
0
        public override void Interpret(IContext context)
        {
            ExpressionA.Interpret(context);
            ExpressionB.Interpret(context);
            var exprAresult = context.Get(ExpressionA);
            var exprBResult = context.Get(ExpressionB);
            var resultA     = exprAresult as string;
            var resultB     = exprBResult as string;

            if (resultA != null && resultB != null &&
                resultA.IndexOf(resultB, StringComparison.Ordinal) != -1)
            {
                context.AddVariable(this, true);
                return;
            }

            context.AddVariable(this, false);
        }