Прочетете на английски Редактиране

Споделяне чрез


TypeInfo.IsAssignableFrom Method

Definition

Overloads

IsAssignableFrom(TypeInfo)

Returns a value that indicates whether the specified type can be assigned to the current type.

IsAssignableFrom(Type)

IsAssignableFrom(TypeInfo)

Source:
TypeInfo.cs
Source:
TypeInfo.cs
Source:
TypeInfo.cs

Returns a value that indicates whether the specified type can be assigned to the current type.

C#
public virtual bool IsAssignableFrom(System.Reflection.TypeInfo typeInfo);
C#
public virtual bool IsAssignableFrom(System.Reflection.TypeInfo? typeInfo);

Parameters

typeInfo
TypeInfo

The type to check.

Returns

true if the specified type can be assigned to this type; otherwise, false.

Applies to

.NET 10 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

IsAssignableFrom(Type)

C#
public virtual bool IsAssignableFrom(Type c);

Parameters

c
Type

Returns

Applies to

.NET Core 1.1 и други версии
Продукт Версии
.NET Core 1.0, Core 1.1
.NET Standard 1.5, 1.6