Пример #1
0
        private async Task <ReplyMessage> CheckValid(IConversationContext conversationContext, FormReplyMessage formReplyMessage, FormReplyMessageProperty property)
        {
            if (property?.Validators != null)
            {
                foreach (var validator in property.Validators)
                {
                    var validationMessage = await(Task <ReplyMessage>) this.genericExpressionFactory.Create(validator.ValidatorType, this.validatorFactory, conversationContext, validator.ValidatorData.ToString());
                    if (validationMessage != null)
                    {
                        return(validationMessage);
                    }
                }
            }

            return(null);
        }
Пример #2
0
        private async Task <bool> CheckActive(IConversationContext conversationContext, FormReplyMessage formReplyMessage, FormReplyMessageProperty property)
        {
            if (property?.ActiveConstraints != null)
            {
                foreach (var activeConstraint in property.ActiveConstraints)
                {
                    var isActive = await(Task <bool>) this.genericExpressionFactory.Create(activeConstraint.ActiveConstraintType, this.activeConstraintFactory, conversationContext, activeConstraint.ActiveConstraintData.ToString());
                    if (!isActive)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }