StringValidator.CanValidate(Type) Méthode

Définition

Détermine si un objet peut être validé en fonction du type.

public:
 override bool CanValidate(Type ^ type);
public override bool CanValidate(Type type);
override this.CanValidate : Type -> bool
Public Overrides Function CanValidate (type As Type) As Boolean

Paramètres

type
Type

Type d’objet.

Retours

true si le type paramètre correspond à une chaîne ; sinon, false.

Exemples

L’exemple suivant montre comment utiliser la CanValidate méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la StringValidator classe.

// Determine if the object to validate can be validated.
Console.WriteLine("CanValidate: {0}",
  myStrValidator.CanValidate(testVal.GetType()));
' Determine if the object to validate can be validated.
Console.WriteLine("CanValidate: {0}", _
  myStrValidator.CanValidate(testVal.GetType()))

S’applique à