, , , , (, ).
IsAssignableFrom , System.Reflection, (. 1191). ( ) , , , mscorlib.
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern bool CanCastTo(IntPtr target);
as , .
If you have good reason for this, it can be beneficial (and faster) to catch an exception and create a cache type of types as they are evaluated. I would definitely be interested in a better solution.
source
share