Example #1
0
 /// <summary>
 /// Evaluates the expression when formatting a message.
 /// </summary>
 /// <param name="field">
 /// It's the field to format.
 /// </param>
 /// <param name="formatterContext">
 /// It's the context of formatting to be used by the method.
 /// </param>
 /// <returns>
 /// A boolean value.
 /// </returns>
 public override bool EvaluateFormat(Field field, ref FormatterContext formatterContext)
 {
     return(GetSubstring(MessageExpression.GetLeafFieldValueString(ref formatterContext, null)) ==
            _valueExpression.Constant);
 }
Example #2
0
 /// <summary>
 /// Evaluates the expression when parsing a message.
 /// </summary>
 /// <param name="parserContext">
 /// It's the parser context.
 /// </param>
 /// <returns>
 /// A boolean value.
 /// </returns>
 public override bool EvaluateParse(ref ParserContext parserContext)
 {
     return(GetSubstring(MessageExpression.GetLeafFieldValueString(ref parserContext, null)) ==
            _valueExpression.Constant);
 }