StringValidator.CanValidate(Type) 메서드
정의
형식에 따라 개체의 유효성을 검사할 수 있는지 여부를 확인합니다.Determines whether an object can be validated based on 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
매개 변수
- type
- Type
개체 형식입니다.The object type.
반환
type
매개 변수가 문자열과 일치하면 true
이고, 그렇지 않으면 false
입니다.true
if the type
parameter matches a string; otherwise, false
.
예제
다음 예제에서는 CanValidate 메서드를 사용하는 방법을 보여 줍니다.The following example demonstrates how to use the CanValidate method. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 StringValidator 클래스입니다.This code example is part of a larger example provided for the StringValidator class.
// 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()))