Exemplo n.º 1
0
        private void ValidateAction(ParserContext parserContext, RuleAction action)
        {
            if (!action.Validate(validation))
            {
                // Choose the first one and throw it.
                ValidationError error = Validator.Errors[0];

                // Try to get the position, or just use zero if we can't.
                object errorObject = error.UserData[RuleUserDataKeys.ErrorObject];
                int position = 0;
                parserContext.exprPositions.TryGetValue(errorObject, out position);

                throw new RuleSyntaxException(error.ErrorNumber, error.ErrorText, position);
            }
        }
 private void ValidateAction(ParserContext parserContext, RuleAction action)
 {
     if (!action.Validate(this.validation))
     {
         ValidationError error = this.Validator.Errors[0];
         object key = error.UserData["ErrorObject"];
         int num = 0;
         parserContext.exprPositions.TryGetValue(key, out num);
         throw new RuleSyntaxException(error.ErrorNumber, error.ErrorText, num);
     }
 }