PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Type­Signature­Extensions Class / Type­Signature­Extensions Methods / Type­Signature­Extensions.​Is­Assignable­To Method / Type­Signature­Extensions.​Is­Assignable­To Method (IType­Signature, IType­Signature)

TypeSignatureExtensions.IsAssignableTo Method (ITypeSignature, ITypeSignature)

Determines whether instances of the current type is assignable to locations of a specified type (i.e. whether the current type derives or implements this type).

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public static bool IsAssignableTo(
	this ITypeSignature derivedType,
	ITypeSignature baseType
)

Parameters

derivedType
Type: PostSharp.Sdk.CodeModel.ITypeSignature
The derived type.
baseType
Type: PostSharp.Sdk.CodeModel.ITypeSignature
The type that the current type may derive or inherit.

Return Value

Type: Boolean
true if the current type can be assigned to (i.e., derives or implements) baseType, otherwise false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ITypeSignature. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
There are some exceptions to the rule that a type can be assigned to another if it derives or implements it. For instance, an Int32 is assignable to an UInt32.
See Also