Share via


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 paramètre type correspond à une chaîne ; sinon, false.

Exemples

L'exemple suivant décrit comment utiliser la méthode CanValidate. 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 à