Exemplo n.º 1
0
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out MethodInstantiationHandle handle)
        {
            uint value;

            offset = reader.DecodeUnsigned(offset, out value);
            handle = new MethodInstantiationHandle((int)value);
            handle._Validate();
            return(offset);
        } // Read
Exemplo n.º 2
0
        /// <summary>
        /// Emit generic method instantiation to the output string builder.
        /// </summary>
        /// <param name="methodInstHandle">Method instantiation handle</param>
        private void EmitMethodInstantiationName(MethodInstantiationHandle methodInstHandle)
        {
            MethodInstantiation   methodInst      = _metadataReader.GetMethodInstantiation(methodInstHandle);
            MemberReferenceHandle methodRefHandle = methodInst.Method.ToMemberReferenceHandle(_metadataReader);
            MemberReference       methodRef       = methodRefHandle.GetMemberReference(_metadataReader);
            MethodSignature       methodSignature;

            EmitReturnTypeContainingTypeAndMethodName(methodRef, out methodSignature);
            EmitGenericArguments(methodInst.GenericTypeArguments);
            EmitMethodParameters(methodSignature);
        }
Exemplo n.º 3
0
        private Object ResolveMethodInstantiation(MethodInstantiationHandle handle)
        {
            MethodInstantiation     methodInstantiation = _metadataReader.GetMethodInstantiation(handle);
            MethodDesc              genericMethodDef    = (MethodDesc)GetObject(methodInstantiation.Method, null);
            ArrayBuilder <TypeDesc> instantiation       = new ArrayBuilder <TypeDesc>();

            foreach (Handle genericArgHandle in methodInstantiation.GenericTypeArguments)
            {
                instantiation.Add(GetType(genericArgHandle));
            }
            return(Context.GetInstantiatedMethod(genericMethodDef, new Instantiation(instantiation.ToArray())));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Emit generic method instantiation to the output string builder.
        /// </summary>
        /// <param name="methodInstHandle">Method instantiation handle</param>
        private void EmitMethodInstantiationName(MethodInstantiationHandle methodInstHandle)
        {
            MethodInstantiation methodInst = _metadataReader.GetMethodInstantiation(methodInstHandle);
            MethodSignature     methodSignature;

            if (methodInst.Method.HandleType == HandleType.MemberReference)
            {
                MemberReferenceHandle methodRefHandle = methodInst.Method.ToMemberReferenceHandle(_metadataReader);
                MemberReference       methodRef       = methodRefHandle.GetMemberReference(_metadataReader);
                EmitContainingTypeAndMethodName(methodRef, out methodSignature);
            }
            else
            {
                QualifiedMethodHandle qualifiedMethodHandle = methodInst.Method.ToQualifiedMethodHandle(_metadataReader);
                QualifiedMethod       qualifiedMethod       = _metadataReader.GetQualifiedMethod(qualifiedMethodHandle);
                EmitContainingTypeAndMethodName(qualifiedMethod, out methodSignature);
            }
            EmitGenericArguments(methodInst.GenericTypeArguments);
            EmitMethodParameters(methodSignature);
        }