Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Runtime.​InteropServices.​IDynamicInterfaceCastable

Assembly: System.Runtime.InteropServices

Interface used to participate in a type cast failure.

Methods

public bool
IsInterfaceImplemented​(RuntimeTypeHandle interfaceType, bool throwIfNotImplemented)
interfaceType The interface type.
throwIfNotImplemented Indicates if the function should throw an exception instead of returning <see langword="false" /> .
Returns <see langword="true" /> if this object can be cast to the given interface; otherwise, <see langword="false" /> .
Called when an implementing class instance is cast to an interface type that is not contained in the class's metadata.
GetInterfaceImplementation​(RuntimeTypeHandle interfaceType)
interfaceType The interface type.
Returns The type that should be used to dispatch for <paramref name="interfaceType" /> on the current object.
Called during interface dispatch when the given interface type cannot be found in the class's metadata.