本文整理汇总了C#中InputElementType类的典型用法代码示例。如果您正苦于以下问题:C# InputElementType类的具体用法?C# InputElementType怎么用?C# InputElementType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputElementType类属于命名空间,在下文中一共展示了InputElementType类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ApplyBrowserValidation
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());
}
开发者ID:reharik,项目名称:MethodFitness,代码行数:7,代码来源:ValidateDateComesAfterAttribute.cs
示例2: ApplyBrowserValidation
/// <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());
}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:16,代码来源:SingleValidator.cs
示例3: ApplyBrowserValidation
/// <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());
}
开发者ID:ralescano,项目名称:castle,代码行数:14,代码来源:GuidValidator.cs
示例4: CreateGenerator
/// <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);
}
开发者ID:ralescano,项目名称:castle,代码行数:11,代码来源:FValidateValidator.cs
示例5: FValidateGenerator
/// <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;
}
开发者ID:ralescano,项目名称:castle,代码行数:10,代码来源:FValidateValidator.cs
示例6: ApplyBrowserValidation
/// <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)
{
}
开发者ID:gusgorman,项目名称:Castle.Components.Validator,代码行数:14,代码来源:SetValidator.cs
示例7: ApplyBrowserValidation
/// <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();
}
}
开发者ID:bittercoder,项目名称:Castle.Components.Validator,代码行数:36,代码来源:RangeValidator.cs
示例8: ApplyBrowserValidation
/// <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());
}
开发者ID:gitter-badger,项目名称:Core-8,代码行数:15,代码来源:IPAddressValidator.cs
示例9: PrototypeValidationGenerator
/// <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;
}
开发者ID:RemiBou,项目名称:MonoRail,代码行数:12,代码来源:PrototypeWebValidator.cs
示例10: ApplyBrowserValidation
/// <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());
}
开发者ID:bittercoder,项目名称:Castle.Components.Validator,代码行数:15,代码来源:GroupNotEmptyValidator.cs
示例11: ApplyValidation
/// <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);
}
}
}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:37,代码来源:FormHelper.cs
示例12: CreateGenerator
/// <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);
}
开发者ID:candland,项目名称:Castle.MonoRail,代码行数:12,代码来源:JQueryValidator.cs
示例13: ApplyBrowserValidation
/// <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);
}
}
}
}
开发者ID:ralescano,项目名称:castle,代码行数:42,代码来源:LengthValidator.cs
示例14: ZebdaWebValidationGenerator
/// <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;
}
开发者ID:smoothdeveloper,项目名称:Castle.MonoRail,代码行数:9,代码来源:ZebdaWebValidator.cs
示例15: CreateGenerator
/// <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);
}
开发者ID:xwyangjshb,项目名称:cuyahoga,代码行数:11,代码来源:JQueryValidator.cs
示例16: JQueryValidationGenerator
/// <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;
}
开发者ID:xwyangjshb,项目名称:cuyahoga,代码行数:12,代码来源:JQueryValidator.cs
注:本文中的InputElementType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论