NVelocity.Runtime.Parser.Node.ASTAndNode.Evaluate C# (CSharp) Méthode

Evaluate() public méthode

logical and : null && right = false left && null = false null && null = false
public Evaluate ( IInternalContextAdapter context ) : bool
context IInternalContextAdapter
Résultat bool
		public override bool Evaluate(IInternalContextAdapter context)
		{
			INode left = GetChild(0);
			INode right = GetChild(1);

			// if either is null, lets log and bail
			if (left == null || right == null)
			{
				rsvc.Error((left == null ? "Left" : "Right") + " side of '&&' operation is null." + " Operation not possible. " +
				           context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
				return false;
			}

			// short circuit the test.  Don't eval the RHS if the LHS is false
			if (left.Evaluate(context))
				if (right.Evaluate(context))
					return true;

			return false;
		}
	}