AdapterHelper.IsValidTypeSubstitution Method

Namespace
Kampute.DocToolkit.Metadata.Adapters
Assembly
  • Kampute.DocToolkit.dll

Definition

Determines whether a target type is a valid substitution for a source type in the context of method overriding or interface implementation.
public static bool IsValidTypeSubstitution(
	IMember baseMember,
	IType sourceType,
	IMember derivedMember,
	IType targetType)

Parameters

baseMember IMember
The base declaration of the member.
sourceType IType
The type used by the base declaration that may be substituted.
derivedMember IMember
The derived or implementing declaration of the member.
targetType IType
The type used by the derived or implementing declaration that may substitute sourceType.

Returns

bool
true if targetType is a valid substitution for sourceType; otherwise, false.

Exceptions

ArgumentNullException
Thrown when any argument is null.