Afficher en anglais

Partage via


LongValidator.CanValidate(Type) Méthode

Définition

Détermine si le type de l'objet peut être validé.

C#
public override bool CanValidate (Type type);

Paramètres

type
Type

Type d'objet.

Retours

true si le paramètre type correspond à une valeur Int64 ; sinon, false.

Exemples

L'exemple de code suivant illustre l'utilisation de la méthode CanValidate. Cet exemple de code fait partie d’un exemple plus grand fourni pour la LongValidator classe .

C#
// Determine if the object to validate can be validated.
Console.WriteLine("CanValidate: {0}",
  myLongValidator.CanValidate(testLong.GetType()));

S’applique à

Produit Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9