TypeProvider.IsAssignable(Type, Type) 方法

定义

指示是否可以安全地将一个类型分配给另一个类型。Indicates whether one type can be safely assigned to another type.

public:
 static bool IsAssignable(Type ^ toType, Type ^ fromType);
public static bool IsAssignable (Type toType, Type fromType);
static member IsAssignable : Type * Type -> bool
Public Shared Function IsAssignable (toType As Type, fromType As Type) As Boolean

参数

toType
Type

赋值的目标 TypeThe target Type of the assignment.

fromType
Type

赋值的源 TypeThe source Type of the assignment.

返回

如果可以安全执行赋值,则为 true;否则为 falsetrue if the assignment can be safely made; otherwise false.

适用于