_Type.IsAssignableFrom(Type) 方法

定义

为 COM 对象提供对 IsAssignableFrom(Type) 方法的与版本无关的访问。Provides COM objects with version-independent access to the IsAssignableFrom(Type) method.

public:
 bool IsAssignableFrom(Type ^ c);
public bool IsAssignableFrom (Type c);
abstract member IsAssignableFrom : Type -> bool
Public Function IsAssignableFrom (c As Type) As Boolean

参数

c
Type

要与当前的 Type 进行比较的 TypeThe Type to compare with the current Type.

返回

如果满足下列任一条件,则为 truec 和当前 Type 表示同一类型;当前 Type 位于 c 的继承层次结构中;当前 Typec 实现的接口;c 是泛型类型参数且当前 Type 表示 c 的约束之一。true if c and the current Type represent the same type, or if the current Type is in the inheritance hierarchy of c, or if the current Type is an interface that c implements, or if c is a generic type parameter and the current Type represents one of the constraints of c. 如果这些条件都不成立,或者 cnull,则为 falsefalse if none of these conditions are the case, or if c is null.

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

适用于