TypeBuilder.IsAssignableFrom 方法

定義

判斷指定類型是否可以指派給這個物件。Determines whether a specified type can be assigned to this object.

多載

IsAssignableFrom(TypeInfo)

取得值,指出是否可以將指定的 TypeInfo 物件指派給這個物件。Gets a value that indicates whether a specified TypeInfo object can be assigned to this object.

IsAssignableFrom(Type)

取得值,指出是否可以將指定的 Type 指派給這個物件。Gets a value that indicates whether a specified Type can be assigned to this object.

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
Public Overrides Function IsAssignableFrom (typeInfo As TypeInfo) As Boolean

參數

typeInfo
TypeInfo

要測試的物件。The object to test.

傳回

Boolean

如果可以將 typeInfo 指派給這個物件,則為 true,否則為 falsetrue if typeInfo can be assigned to this object; otherwise, false.

適用於

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);
public override bool IsAssignableFrom (Type c);
override this.IsAssignableFrom : Type -> bool
Public Overrides Function IsAssignableFrom (c As Type) As Boolean

參數

c
Type

要測試的物件。The object to test.

傳回

Boolean

如果 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.

適用於