DevForce Help Reference
IVerifierProvider Interface
Members  Example 


Interface to be implemented to provide verifiers dynamically at run time.
Syntax
'Declaration
 
<InterfaceExportAttribute(ContractName="", ContractType=IdeaBlade.Validation.IVerifierProvider)>
Public Interface IVerifierProvider 
'Usage
 
Dim instance As IVerifierProvider
[InterfaceExport(ContractName="", ContractType=IdeaBlade.Validation.IVerifierProvider)]
public interface IVerifierProvider 
Remarks
You can include any number of IVerifierProvider implementations in your application. Verifier providers are automatically discovered as attributed verifiers are processed, but you may also call VerifierEngine.DiscoverVerifiers to force discovery of verifiers for the applicable type.
Example
public class EmployeeVerifierProvider : IVerifierProvider {

  public  IEnumerable<Verifier> GetVerifiers(Object verifierProviderContext) {
    // Return a few verifiers.
    yield return GetFirstNameVerifier();
    yield return GetLastNameVerifier();
  }

  private Verifier GetLastNameVerifier() {
    return new StringLengthVerifier(typeof(Employee), "LastName", true, 3, 15);
  }

  private Verifier GetFirstNameVerifier() {
    return new StringLengthVerifier(typeof(Employee), Employee.PathFor(e => e.FirstName), false, null, 50);
  }
  
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IVerifierProvider Members
IdeaBlade.Validation Namespace

Send Feedback