TypeBuilder.IsAssignableFrom TypeBuilder.IsAssignableFrom TypeBuilder.IsAssignableFrom TypeBuilder.IsAssignableFrom Method

定义

确定某个指定类型是否可以赋值给此对象。Determines whether a specified type can be assigned to this object.

重载

IsAssignableFrom(TypeInfo) IsAssignableFrom(TypeInfo) IsAssignableFrom(TypeInfo)

获取一个值,该值表示是否可以将指定的 TypeInfo 对象赋值给此对象。Gets a value that indicates whether a specified TypeInfo object can be assigned to this object.

IsAssignableFrom(Type) IsAssignableFrom(Type) IsAssignableFrom(Type) IsAssignableFrom(Type)

获取一个值,该值指示是否可将指定的 Type 分配给此对象。Gets a value that indicates whether a specified Type can be assigned to this object.

IsAssignableFrom(TypeInfo) IsAssignableFrom(TypeInfo) IsAssignableFrom(TypeInfo)

获取一个值,该值表示是否可以将指定的 TypeInfo 对象赋值给此对象。Gets a value that indicates whether a specified TypeInfo object can be assigned to this object.

public:
 override bool IsAssignableFrom(System::Reflection::TypeInfo ^ typeInfo);
public override bool IsAssignableFrom (System.Reflection.TypeInfo typeInfo);
override this.IsAssignableFrom : System.Reflection.TypeInfo -> bool

参数

typeInfo
TypeInfo TypeInfo TypeInfo TypeInfo

要测试的对象。The object to test.

返回

如果可以将 typeInfo 赋值给此对象,则为 true;否则为 falsetrue if typeInfo can be assigned to this object; otherwise, false.

IsAssignableFrom(Type) IsAssignableFrom(Type) IsAssignableFrom(Type) IsAssignableFrom(Type)

获取一个值,该值指示是否可将指定的 Type 分配给此对象。Gets a value that indicates whether a specified Type can be assigned to this object.

public:
 override bool IsAssignableFrom(Type ^ c);
public override bool IsAssignableFrom (Type c);
override this.IsAssignableFrom : Type -> bool
Public Overrides Function IsAssignableFrom (c As Type) As Boolean

参数

c
Type Type Type Type

要测试的对象。The object to test.

返回

如果 c 参数和当前类型表示相同的类型,或当前类型位于 c 的继承层次结构中,或当前类型是 c 支持的接口,则为 truetrue if the c parameter 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 supports. 如果上述条件均无效或 cnull;则为 falsefalse if none of these conditions are valid, or if c is null.

适用于