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

对象的类型。

返回

如果 type 参数与 Int64 值相匹配,则为 true;否则为 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()))

适用于