IdeaBlade DevForce 2010 Help Reference
IVerifierProvider Interface
Members  Example  See Also  Send Feedback
IdeaBlade.Validation Assembly > IdeaBlade.Validation Namespace : IVerifierProvider Interface



Interface to be implemented to provide verifiers dynamically at run time.

Syntax

Visual Basic (Declaration) 
<InterfaceExportAttribute(ContractName="", ContractType=IdeaBlade.Validation.IVerifierProvider)>
Public Interface IVerifierProvider 
Visual Basic (Usage)Copy Code
Dim instance As IVerifierProvider
C# 
[InterfaceExportAttribute(ContractName="", ContractType=IdeaBlade.Validation.IVerifierProvider)]
public interface IVerifierProvider 
C++/CLI 
[InterfaceExportAttribute(ContractName="", ContractType=IdeaBlade.Validation.IVerifierProvider)]
public interface class IVerifierProvider 

Example

C#Copy Code
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);
  }
  
}

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.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.