System.ModuleHandle.ResolveFieldHandle C# (CSharp) Méthode

ResolveFieldHandle() public méthode

public ResolveFieldHandle ( int fieldToken, RuntimeTypeHandle typeInstantiationContext, RuntimeTypeHandle methodInstantiationContext ) : RuntimeFieldHandle
fieldToken int
typeInstantiationContext RuntimeTypeHandle
methodInstantiationContext RuntimeTypeHandle
Résultat RuntimeFieldHandle
        public RuntimeFieldHandle ResolveFieldHandle(int fieldToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
        {
            ValidateModulePointer();
            
            // defensive copy to be sure array is not mutated from the outside during processing
            typeInstantiationContext = CopyRuntimeTypeHandles(typeInstantiationContext);
            methodInstantiationContext = CopyRuntimeTypeHandles(methodInstantiationContext);
            
            unsafe
            {
                if (typeInstantiationContext == null || typeInstantiationContext.Length == 0) 
                {
                    if (methodInstantiationContext == null || methodInstantiationContext.Length == 0) 
                    {
                        // no context
                        return ResolveField(fieldToken, null, 0, null, 0);
                    }
                    // only method context available
                    int instCount = methodInstantiationContext.Length;
                    fixed (RuntimeTypeHandle* instArgs = methodInstantiationContext) {
                        return ResolveField(fieldToken, null, 0, instArgs, instCount);
                    }
                }
                if (methodInstantiationContext == null || methodInstantiationContext.Length == 0) 
                {
                    // only type context available
                    int instCount = typeInstantiationContext.Length;
                    fixed (RuntimeTypeHandle* instArgs = typeInstantiationContext) {
                        return ResolveField(fieldToken, instArgs, instCount, null, 0);
                    }
                }
                // pin both
                int typeInstCount = typeInstantiationContext.Length;
                int methodInstCount = methodInstantiationContext.Length;
                fixed (RuntimeTypeHandle* typeInstArgs = typeInstantiationContext, methodInstArgs = methodInstantiationContext) {
                    return ResolveField(fieldToken, typeInstArgs, typeInstCount, methodInstArgs, methodInstCount);
                }
            }
        }
        [MethodImplAttribute(MethodImplOptions.InternalCall)]        

Same methods

ModuleHandle::ResolveFieldHandle ( int fieldToken ) : RuntimeFieldHandle