예제 #1
0
        public bool Evaluate(MessageDataItem dataItem)
        {
            Variant firstValue = FirstValue.GetValue(dataItem);
            string  message    = null;

            switch (firstValue.Type)
            {
            case VariantType.Boolean: message = firstValue.BooleanValue.ToString(); break;

            case VariantType.DateTime: message = firstValue.DateTimeValue.ToString("o"); break;

            case VariantType.Float: message = firstValue.FloatValue.ToString(); break;

            case VariantType.Int: message = firstValue.IntValue.ToString(); break;

            case VariantType.String: message = firstValue.StringValue; break;
            }

            if (Operator == RegExExpressionOperator.Matches)
            {
                return(RegularExpressions.Evaluate(message));
            }
            if (Operator == RegExExpressionOperator.NotMatches)
            {
                return(!RegularExpressions.Evaluate(message));
            }

            return(false);
        }