LongValidator.CanValidate(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

对象的类型。

返回

true如果参数与值匹配type,则为 Int64;否则为 false

示例

下面的代码示例演示如何使用 CanValidate 该方法。 该代码示例是 LongValidator 类中的一个较大示例的一部分。

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

适用于