WFTypeRuleProvider

Constructors
  • WFTypeRuleProvider(object model)
Initializes a new instance of the WFTypeRuleProvider class and uses the type of "model" to determine validation rules.
If the type of "model" is decorated with [MetadataTypeAttribute] then rules will be provided from the MetadataType.
  • WFTypeRuleProvider(Type t)
Initializes a new instance of the WFTypeRuleProvider class and uses type "t" to determine validation rules.
If type "t" is decorated with [MetadataTypeAttribute] then rules will be provided from the MetadataType.
Interface Implementations
  • IWFRuleProvider.ValidationType
Gets or set the type rules have been derived from. Setting the type will not trigger a refresh of the validation rules.
  • IWFRuleProvider.GetClassValidationAttributes
Used when validation takes place. This will return any validation rules applied directly to the class.
  • IWFRuleProvider.GetPropertyValidationAttributes(string propertyName)
Used when validation takes place. This will return any validation rules applied to a PropertyInfo whose name matches propertyName. It is case-insensitive.
If no property matches, an empty collection of ValidationAttribute is returned.
  • IWFRuleProvider.GetDisplayNameForProperty(string propertyName)
If the property has a [DisplayName] attribute, the display name will be pulled from this attribute. Otherwise, the property .Name will be used. If no property is found, null will be returned.
  • IWFRuleProvider.ModelDisplayName
Get or set the display name of the type used to provide validation rules.
If [DisplayName] is not present, the type.Name will be used.

Last edited May 19, 2012 at 9:13 PM by aikeru, version 3

Comments

No comments yet.