protected override bool InternalEval(ILogicTermSource source) { var text = FirstIsLiteral ? source.Value(First) : First; var regex = SecondIsLiteral ? source.Value(Second) : Second; return(Regex.IsMatch(text, regex)); }
/// <summary> /// evaluates bool value of node /// </summary> /// <param name="source"> </param> /// <returns> </returns> public bool Eval(ILogicTermSource source) { var result = InternalEval(source); if (Negative) { result = !result; } return result; }
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { var resolvefst = FirstLiteral.StartsWith("$") ? FirstLiteral.Substring(1) : FirstLiteral; var resolvesec = SecondLiteral.StartsWith("$") ? SecondLiteral.Substring(1) : SecondLiteral; var fst = source.Value(resolvefst); var sec = source.Value(resolvesec); return(AreMatched(fst, sec)); }
/// <summary> /// evaluates bool value of node /// </summary> /// <param name="source"> </param> /// <returns> </returns> public bool Eval(ILogicTermSource source) { var result = InternalEval(source); if (Negative) { result = !result; } return(result); }
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { return source.Get(Literal); }
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { return(AreMatched(source.Value(Literal), Value)); }
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { return Children.Select(e => e.Eval(source)).All(r => r); }
/// <summary> /// must override - real implementation of Bool value retrive /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected abstract bool InternalEval(ILogicTermSource source);
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { return(Children.Select(e => e.Eval(source)).All(r => r)); }
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { return AreMatched(source.Value(Literal), Value); }
/// <summary> /// </summary> /// <param name="source"> </param> /// <returns> </returns> protected override bool InternalEval(ILogicTermSource source) { return(source.Get(Literal)); }