Пример #1
0
 void SetInputElementType()
 {
     if (HasAttribute("type"))
     {
         string TypeVal = GetAttribute("type");
         if (TypeVal.Equals("password", StringComparison.OrdinalIgnoreCase))
         {
             EleType = InputElementType.Password;
         }
         else if (TypeVal.Equals("hidden", StringComparison.OrdinalIgnoreCase))
         {
             EleType = InputElementType.Hidden;
         }
         else if (TypeVal.Equals("submit", StringComparison.OrdinalIgnoreCase))
         {
             EleType = InputElementType.Submit;
         }
         else if (TypeVal.Equals("checkbox", StringComparison.OrdinalIgnoreCase))
         {
             EleType = InputElementType.Checkbox;
         }
         else if (TypeVal.Equals("radio", StringComparison.OrdinalIgnoreCase))
         {
             EleType = InputElementType.Radio;
         }
         else if (TypeVal.Equals("text", StringComparison.OrdinalIgnoreCase))
         {
             EleType = InputElementType.Text;
         }
     }
 }
Пример #2
0
        /// <summary>
        /// Applies the validation.
        /// </summary>
        /// <param name="inputType">Type of the input.</param>
        /// <param name="target">The target.</param>
        /// <param name="attributes">The attributes.</param>
        protected virtual void ApplyValidation(InputElementType inputType, string target, ref IDictionary attributes)
        {
            var disableValidation = CommonUtils.ObtainEntryAndRemove(attributes, "disablevalidation", "false") == "true";

            if (!IsValidationEnabled || disableValidation)
            {
                return;
            }

            if (validatorRegistry == null || validationConfig == null)
            {
                return;
            }

            if (attributes == null)
            {
                attributes = new HybridDictionary(true);
            }

            var validators = CollectValidators(RequestContext.All, target);

            var generator = validatorProvider.CreateGenerator(validationConfig, inputType, attributes);

            var id = CreateHtmlId(attributes, target, false);

            foreach (var validator in validators)
            {
                if (validator.SupportsBrowserValidation)
                {
                    validator.ApplyBrowserValidation(validationConfig, inputType, generator, attributes, id);
                }
            }
        }
Пример #3
0
		/// <summary>
		/// Applies the browser validation by setting up one or
		/// more input rules on <see cref="IBrowserValidationGenerator"/>.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="target">The target.</param>
		public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
		                                            IBrowserValidationGenerator generator, IDictionary attributes,
		                                            string target)
		{
			base.ApplyBrowserValidation(config, inputType, generator, attributes, target);
			generator.SetDigitsOnly(target, BuildErrorMessage());
		}
 public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
                                             IBrowserValidationGenerator generator, IDictionary attributes,
                                             string target)
 {
     base.ApplyBrowserValidation(config, inputType, generator, attributes, target);
     generator.SetAsNotSameAs(target, this.propertyToCompare, this.BuildErrorMessage());
 }
        private void ValidateInputNode(
            ParsedInputElement node,
            string element,
            InputElementType type,
            int index,
            ParsedInputElement pairedWith,
            string value,
            int startPos = -1,
            int endPos   = -1)
        {
            node.Raw.Should().Be(element);
            node.ElementType.Should().Be(type);
            node.Index.Should().Be(index);
            node.IsPairedWith.Should().Be(pairedWith);
            node.Value.Should().Be(value);

            if (startPos > -1)
            {
                node.StartPosition.Should().Be(startPos);
            }

            if (endPos > -1)
            {
                node.EndPosition.Should().Be(endPos);
            }
        }
        public void EnsureValueType()
        {
            var type = InputElementType.ResolveValueType(this);

            if (type != null)
            {
                ValueType = type;
            }
        }
Пример #7
0
        public void AppendField(int sort, string name, string field, InputElementType Type, IDictionary <int, string> selectValue)
        {
            this.ApplyChange(new ChannelExtendFieldsCreatedEvent
            {
                AggregateId = this.AggregateId,
                Timestamp   = DateTime.Now,

                Sort        = sort,
                Field       = field,
                Name        = name,
                Type        = Type,
                SelectValue = selectValue
            });
        }
Пример #8
0
        public InputPropertyPanel(InputElementType elementType, String name, String text, String value)
        {
            this.ElementType = elementType;
            if (this.ElementType == InputElementType.Color)
            {
                this.LoadDefaultColor();
            }
            this.Name = name;
            this.Text = text;
            this.RadioButtonGroupName = name;
            this.ValidationResultMessagePanel.ValidationName.SetValue(name);
            this.Value = value;

            foreach (var item in Default.DurationList)
            {
                this.DurationList.Add(new PropertyValueItem(item.Value));
            }
            this.SelectedDuration = "1:00";
        }
Пример #9
0
 public InputPropertyPanel(InputElementType elementType, String name, String text, Guid value)
     : this(elementType, name, text, value.ToString())
 {
 }
Пример #10
0
 /// <summary>
 /// Applies the browser validation by setting up one or
 /// more input rules on <see cref="IBrowserValidationGenerator"/>.
 /// </summary>
 /// <param name="config">The config.</param>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="generator">The generator.</param>
 /// <param name="attributes">The attributes.</param>
 /// <param name="name">The name.</param>
 public void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
                                    IBrowserValidationGenerator generator, IDictionary attributes,
                                    string name)
 {
     generator.SetAsGroupValidation(name, Name, BuildErrorMessage());
 }
Пример #11
0
 public InputPropertyPanel(InputElementType elementType, String name, String text)
     : this(elementType, name, text, "")
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FValidateGenerator"/> class.
 /// </summary>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="attributes">The attributes.</param>
 public FValidateGenerator(InputElementType inputType, IDictionary attributes)
 {
     this.inputType  = inputType;
     this.attributes = attributes;
 }
Пример #13
0
		/// <summary>
		/// Applies the browser validation by setting up one or
		/// more input rules on <see cref="IBrowserValidationGenerator"/>.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="target">The target.</param>
		public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, System.Collections.IDictionary attributes, string target)
		{
			base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

			generator.SetRegExp(target, @"^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$", BuildErrorMessage());
		}
Пример #14
0
 /// <summary>
 /// Applies the browser validation by setting up one or
 /// more input rules on <see cref="IBrowserValidationGenerator"/>.
 /// </summary>
 /// <param name="config">The config.</param>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="generator">The generator.</param>
 /// <param name="attributes">The attributes.</param>
 /// <param name="target">The target.</param>
 public virtual void ApplyBrowserValidation(BrowserValidationConfiguration config,
                                            InputElementType inputType, IBrowserValidationGenerator generator,
                                            IDictionary attributes, string target)
 {
 }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JQueryValidationGenerator"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="inputElementType">Type of the input element.</param>
 /// <param name="propertyNameToElementId">The attributes.</param>
 public JQueryValidationGenerator(JQueryValidator.JQueryConfiguration configuration, InputElementType inputElementType, Func<string, string> propertyNameToElementId)
 {
     _inputElementType = inputElementType;
     _propertyNameToElementId = propertyNameToElementId;
     _config = configuration;
 }
Пример #16
0
        /// <summary>
        /// Applies the browser validation by setting up one or
        /// more input rules on <see cref="IBrowserValidationGenerator"/>.
        /// </summary>
        /// <param name="config">The config.</param>
        /// <param name="inputType">Type of the input.</param>
        /// <param name="generator">The generator.</param>
        /// <param name="attributes">The attributes.</param>
        /// <param name="target">The target.</param>
        public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
                                                    IBrowserValidationGenerator generator, IDictionary attributes,
                                                    string target)
        {
            base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

            generator.SetAsLesserThan(target, PropertyToCompare, validationType, BuildErrorMessage());
        }
Пример #17
0
        /// <summary>
        /// Applies the browser validation by setting up one or
        /// more input rules on <see cref="IBrowserValidationGenerator"/>.
        /// </summary>
        /// <param name="config">The config.</param>
        /// <param name="inputType">Type of the input.</param>
        /// <param name="generator">The generator.</param>
        /// <param name="attributes">The attributes.</param>
        /// <param name="target">The target.</param>
        public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, System.Collections.IDictionary attributes, string target)
        {
            base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

            generator.SetRegExp(target, @"^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$", BuildErrorMessage());
        }
Пример #18
0
        /// <summary>
        /// Applies the browser validation by setting up one or
        /// more input rules on <see cref="IBrowserValidationGenerator"/>.
        /// </summary>
        /// <param name="config">The config.</param>
        /// <param name="inputType">Type of the input.</param>
        /// <param name="generator">The generator.</param>
        /// <param name="attributes">The attributes.</param>
        /// <param name="target">The target.</param>
        public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
                                                    IBrowserValidationGenerator generator, IDictionary attributes,
                                                    string target)
        {
            base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

            switch (type)
            {
            case RangeValidationType.Integer:
                generator.SetValueRange(target, (int)min, (int)max, BuildErrorMessage());
                break;

            case RangeValidationType.Long:
                generator.SetValueRange(target, (long)min, (long)max, BuildErrorMessage());
                break;

            case RangeValidationType.Decimal:
                generator.SetValueRange(target, (decimal)min, (decimal)max, BuildErrorMessage());
                break;

            case RangeValidationType.DateTime:
                generator.SetValueRange(target, (DateTime)min, (DateTime)max, BuildErrorMessage());
                break;

            case RangeValidationType.String:
                generator.SetValueRange(target, (string)min, (string)max, BuildErrorMessage());
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="ZebdaWebValidationGenerator"/> class.
		/// </summary>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="attributes">The attributes.</param>
		public ZebdaWebValidationGenerator(InputElementType inputType, IDictionary attributes)
		{
			this.attributes = attributes;
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeValidationGenerator"/> class.
 /// </summary>
 /// <param name="config">Validation configuration instance</param>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="attributes">The attributes.</param>
 public PrototypeValidationGenerator(PrototypeValidationConfiguration config, InputElementType inputType, IDictionary attributes)
 {
     this.config     = config;
     this.inputType  = inputType;
     this.attributes = attributes;
 }
Пример #21
0
 public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, System.Collections.IDictionary attributes, string target)
 {
 }
Пример #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZebdaWebValidationGenerator"/> class.
 /// </summary>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="attributes">The attributes.</param>
 public ZebdaWebValidationGenerator(InputElementType inputType, IDictionary attributes)
 {
     this.attributes = attributes;
 }
Пример #23
0
 public PrototypeValidationGeneratorExtension(PrototypeWebValidator.PrototypeValidationConfiguration config, InputElementType inputType, IDictionary attributes)
     : base(config, inputType, attributes)
 {
     _config = config;
 }
Пример #24
0
 /// <summary>
 /// Implementors should return their generator instance.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="inputType"></param>
 /// <param name="propertyNameToElementId"></param>
 /// <returns>A generator instance</returns>
 public IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration configuration, InputElementType inputType, Func <string, string> propertyNameToElementId)
 {
     return(new JQueryValidationGenerator((JQueryConfiguration)configuration, inputType, propertyNameToElementId));
 }
Пример #25
0
    public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, System.Collections.IDictionary attributes, string target)
    {
        base.ApplyBrowserValidation(config, inputType, generator, attributes, target);
        string message = string.Format(defaultErrorMessage, _minLength);

        generator.SetMinLength(target, _minLength, ErrorMessage ?? message);
    }
Пример #26
0
		/// <summary>
		/// Applies the browser validation by setting up one or
		/// more input rules on <see cref="IBrowserValidationGenerator"/>.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="target">The target.</param>
		public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
		                                            IBrowserValidationGenerator generator, IDictionary attributes,
		                                            string target)
		{
			base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

			if (exactLength != int.MinValue)
			{
				string message = string.Format(GetString(MessageConstants.ExactLengthMessage), exactLength);
				generator.SetExactLength(target, exactLength, ErrorMessage ?? message);
			}
			else
			{
				if (minLength != int.MinValue && maxLength != int.MaxValue)
				{
					string message = string.Format(GetString(MessageConstants.LengthInRangeMessage), minLength, maxLength);
					generator.SetLengthRange(target, minLength, maxLength, ErrorMessage ?? message);
				}
				else
				{
					if (minLength != int.MinValue)
					{
						string message = string.Format(GetString(MessageConstants.LengthTooShortMessage), minLength);
						generator.SetMinLength(target, minLength, ErrorMessage ?? message);
					}
					if (maxLength != int.MaxValue)
					{
						string message = string.Format(GetString(MessageConstants.LengthTooLongMessage), maxLength);
						generator.SetMaxLength(target, maxLength, ErrorMessage ?? message);
					}
				}
			}
		}
Пример #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrototypeValidationGenerator"/> class.
 /// </summary>
 /// <param name="config">Validation configuration instance</param>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="attributes">The attributes.</param>
 public PrototypeValidationGenerator(PrototypeValidationConfiguration config, InputElementType inputType, IDictionary attributes)
 {
     this.config = config;
     this.inputType = inputType;
     this.attributes = attributes;
 }
Пример #28
0
		/// <summary>
		/// Implementors should return their generator instance.
		/// </summary>
		/// <param name="configuration"></param>
		/// <param name="inputType"></param>
		/// <param name="attributes"></param>
		/// <returns>A generator instance</returns>
		public IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration configuration,
		                                                   InputElementType inputType, IDictionary attributes)
		{
			return new JQueryValidationGenerator((JQueryConfiguration) configuration);
		}
Пример #29
0
 /// <summary>
 /// Applies the browser validation.
 /// </summary>
 /// <param name="config">The config.</param>
 /// <param name="inputType">Type of the input.</param>
 /// <param name="generator">The generator.</param>
 /// <param name="attributes">The attributes.</param>
 /// <param name="target">The target.</param>
 public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
                                             IBrowserValidationGenerator generator, IDictionary attributes,
                                             string target)
 {
     generator.SetEmail(target, BuildErrorMessage());
 }
		/// <summary>
		/// Applies the browser validation by setting up one or
		/// more input rules on <see cref="IBrowserValidationGenerator"/>.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="target">The target.</param>
		public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
		                                            IBrowserValidationGenerator generator, IDictionary attributes,
		                                            string target)
		{
		}
 /// <summary>
 /// Implementors should return their generator instance.
 /// </summary>
 /// <param name="config"></param>
 /// <param name="inputType"></param>
 /// <param name="attributes"></param>
 /// <returns>A generator instance</returns>
 public IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration config, InputElementType inputType, IDictionary attributes)
 {
     return(new FValidateGenerator(inputType, attributes));
 }
Пример #32
0
		/// <summary>
		/// Implementors should return their generator instance.
		/// </summary>
		/// <param name="config"></param>
		/// <param name="inputType"></param>
		/// <param name="attributes"></param>
		/// <returns>A generator instance</returns>
		public IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration config, InputElementType inputType, IDictionary attributes)
		{
			return new FValidateGenerator(inputType, attributes);
		}
		/// <summary>
		/// Applies the browser validation by setting up one or
		/// more input rules on <see cref="IBrowserValidationGenerator"/>.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="target">The target.</param>
		public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
		                                            IBrowserValidationGenerator generator, IDictionary attributes,
		                                            string target)
		{
			base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

			switch(type)
			{
				case RangeValidationType.Integer:
					generator.SetValueRange(target, (int) min, (int) max, BuildErrorMessage());
					break;
				case RangeValidationType.Long:
					generator.SetValueRange(target, (long)min, (long)max, BuildErrorMessage());
					break;
				case RangeValidationType.Decimal:
					generator.SetValueRange(target, (decimal) min, (decimal) max, BuildErrorMessage());
					break;
				case RangeValidationType.DateTime:
					generator.SetValueRange(target, (DateTime) min, (DateTime) max, BuildErrorMessage());
					break;
				case RangeValidationType.String:
					generator.SetValueRange(target, (string) min, (string) max, BuildErrorMessage());
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}
		}
Пример #34
0
 /// <summary>
 /// Implementors should return their generator instance.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="inputType"></param>
 /// <param name="attributes"></param>
 /// <returns>A generator instance</returns>
 public IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration configuration,
                                                    InputElementType inputType, IDictionary attributes)
 {
     return(new JQueryValidationGenerator((JQueryConfiguration)configuration));
 }
Пример #35
0
 public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, System.Collections.IDictionary attributes, string target)
 {
     base.ApplyBrowserValidation(config, inputType, generator, attributes, target);
     generator.SetDate(target, BuildErrorMessage());
 }
Пример #36
0
 /// <summary>
 /// Implementors should return their generator instance.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="inputType"></param>
 /// <param name="propertyNameToElementId"></param>
 /// <returns>A generator instance</returns>
 public IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration configuration, InputElementType inputType, Func<string, string> propertyNameToElementId)
 {
     return new JQueryValidationGenerator((JQueryConfiguration)configuration, inputType, propertyNameToElementId);
 }
Пример #37
0
 public InputPropertyPanel(InputElementType elementType, String name, String text, Boolean value)
     : this(elementType, name, text, value.ToString().ToLower())
 {
 }
Пример #38
0
 public FieldValueObject(int Sort, string name, string field, InputElementType type, IDictionary <int, string> selectValue) : base(field, type)
 {
     this.SelectValue = selectValue;
     this.Name        = name;
     this.Sort        = Sort;
 }
Пример #39
0
		/// <summary>
		/// Applies the validation.
		/// </summary>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="target">The target.</param>
		/// <param name="attributes">The attributes.</param>
		protected virtual void ApplyValidation(InputElementType inputType, string target, ref IDictionary attributes)
		{
			bool disableValidation = CommonUtils.ObtainEntryAndRemove(attributes, "disablevalidation", "false") == "true";

			if (!IsValidationEnabled && disableValidation)
			{
				return;
			}

			if (Controller.Validator == null || validationConfig == null)
			{
				return;
			}

			if (attributes == null)
			{
				attributes = new HybridDictionary(true);
			}

			IValidator[] validators = CollectValidators(RequestContext.All, target);

			IBrowserValidationGenerator generator = validatorProvider.CreateGenerator(validationConfig, inputType, attributes);

			foreach(IValidator validator in validators)
			{
				if (validator.SupportsBrowserValidation)
				{
					validator.ApplyBrowserValidation(validationConfig, inputType, generator, attributes, target);
				}
			}
		}
Пример #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JQueryValidationGenerator"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="inputElementType">Type of the input element.</param>
 /// <param name="propertyNameToElementId">The attributes.</param>
 public JQueryValidationGenerator(JQueryValidator.JQueryConfiguration configuration, InputElementType inputElementType, Func <string, string> propertyNameToElementId)
 {
     _inputElementType        = inputElementType;
     _propertyNameToElementId = propertyNameToElementId;
     _config = configuration;
 }
Пример #41
0
			/// <summary>
			/// Initializes a new instance of the <see cref="FValidateGenerator"/> class.
			/// </summary>
			/// <param name="inputType">Type of the input.</param>
			/// <param name="attributes">The attributes.</param>
			public FValidateGenerator(InputElementType inputType, IDictionary attributes)
			{
				this.inputType = inputType;
				this.attributes = attributes;
			}
		/// <summary>
		/// Applies the browser validation by setting up one or
		/// more input rules on <see cref="IBrowserValidationGenerator"/>.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="name">The name.</param>
		public void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
		                                   IBrowserValidationGenerator generator, IDictionary attributes,
		                                   string name)
		{
			generator.SetAsGroupValidation(name, Name, BuildErrorMessage());
		}
Пример #43
0
 public InputElementValueObject(string field, InputElementType type)
 {
     this.Field = field;
     this.Type  = type;
 }
Пример #44
0
 public new IBrowserValidationGenerator CreateGenerator(BrowserValidationConfiguration config, InputElementType inputType, IDictionary attributes)
 {
     return(new PrototypeValidationGeneratorExtension((PrototypeWebValidator.PrototypeValidationConfiguration)config, inputType, attributes));
 }
Пример #45
0
		/// <summary>
		/// Applies the browser validation.
		/// </summary>
		/// <param name="config">The config.</param>
		/// <param name="inputType">Type of the input.</param>
		/// <param name="generator">The generator.</param>
		/// <param name="attributes">The attributes.</param>
		/// <param name="target">The target.</param>
		public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
		                                            IBrowserValidationGenerator generator, IDictionary attributes,
		                                            string target)
		{
			generator.SetEmail(target, BuildErrorMessage());
		}
Пример #46
0
        /// <summary>
        /// Applies the browser validation by setting up one or
        /// more input rules on <see cref="IBrowserValidationGenerator"/>.
        /// </summary>
        /// <param name="config">The config.</param>
        /// <param name="inputType">Type of the input.</param>
        /// <param name="generator">The generator.</param>
        /// <param name="attributes">The attributes.</param>
        /// <param name="target">The target.</param>
        public override void ApplyBrowserValidation(BrowserValidationConfiguration config, InputElementType inputType,
                                                    IBrowserValidationGenerator generator, IDictionary attributes,
                                                    string target)
        {
            base.ApplyBrowserValidation(config, inputType, generator, attributes, target);

            generator.SetRegExp(target, expression, BuildErrorMessage());
        }