SatisfiesConstraints() приватный Метод

private SatisfiesConstraints ( RuntimeTypeHandle typeContext, RuntimeTypeHandle methodContext, RuntimeTypeHandle toType ) : bool
typeContext RuntimeTypeHandle
methodContext RuntimeTypeHandle
toType RuntimeTypeHandle
Результат bool
        internal unsafe static bool SatisfiesConstraints(RuntimeType paramType, RuntimeType[] typeContext, RuntimeType[] methodContext, RuntimeType toType)
        {
            int typeContextLength;

            IntPtr[] array = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeContext, out typeContextLength);
            int      methodContextLength;

            IntPtr[] array2 = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodContext, out methodContextLength);
            fixed(IntPtr *ptr = array)
            {
                fixed(IntPtr *ptr2 = array2)
                {
                    bool result = RuntimeTypeHandle.SatisfiesConstraints(paramType, ptr, typeContextLength, ptr2, methodContextLength, toType);

                    GC.KeepAlive(typeContext);
                    GC.KeepAlive(methodContext);
                    return(result);
                }
            }
        }
Пример #2
0
        internal static unsafe bool SatisfiesConstraints(RuntimeType paramType, RuntimeType[] typeContext, RuntimeType[] methodContext, RuntimeType toType)
        {
            int length1;

            IntPtr[] numArray1 = RuntimeTypeHandle.CopyRuntimeTypeHandles((Type[])typeContext, out length1);
            int      length2;

            IntPtr[] numArray2 = RuntimeTypeHandle.CopyRuntimeTypeHandles((Type[])methodContext, out length2);
            IntPtr[] numArray3 = numArray1;
            // ISSUE: cast to a reference type
            // ISSUE: explicit reference operation
            // ISSUE: explicit reference operation
            fixed(IntPtr *pTypeContext = & ^ (numArray1 == null || numArray3.Length == 0 ? (IntPtr&)IntPtr.Zero : @numArray3[0]))
            fixed(IntPtr * pMethodContext = numArray2)
            {
                int num = RuntimeTypeHandle.SatisfiesConstraints(paramType, pTypeContext, length1, pMethodContext, length2, toType) ? 1 : 0;

                GC.KeepAlive((object)typeContext);
                GC.KeepAlive((object)methodContext);
                return(num != 0);
            }
        }