Exemplo n.º 1
0
        public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[]?typeInstantiationContext, RuntimeTypeHandle[]?methodInstantiationContext)
        {
            if (value == IntPtr.Zero)
            {
                throw new ArgumentNullException(string.Empty, "Invalid handle");
            }
            IntPtr res = RuntimeModule.ResolveTypeToken(value, typeToken, ptrs_from_handles(typeInstantiationContext), ptrs_from_handles(methodInstantiationContext), out _);

            if (res == IntPtr.Zero)
            {
                throw new TypeLoadException(string.Format("Could not load type '0x{0:x}' from assembly '0x{1:x}'", typeToken, value.ToInt64()));
            }
            else
            {
                return(new RuntimeTypeHandle(res));
            }
        }