Ejemplo n.º 1
0
        public FieldReference readFieldReference()
        {
            var name          = readString();
            var declaringType = readTypeReference();

            var fields = getFields(resolve(declaringType), name);

            if (fields == null || fields.Count != 1)
            {
                throw new ApplicationException(string.Format("Couldn't find one field named '{0}' in type {1}",
                                                             name,
                                                             Utils.removeNewlines(declaringType)));
            }

            return(memberReferenceConverter.convert(fields[0]));
        }
Ejemplo n.º 2
0
        protected override TypeReference updateTypeReference(TypeReference a)
        {
            if (a.Module == Module)
            {
                return(a);
            }

            var newTypeRef = new TypeReference(a.Namespace, a.Name, Module, memberReferenceConverter.convert(a.Scope), a.IsValueType);

            foreach (var gp in a.GenericParameters)
            {
                newTypeRef.GenericParameters.Add(new GenericParameter(gp.Name, newTypeRef));
            }
            newTypeRef.DeclaringType = update(a.DeclaringType);
            newTypeRef.UpdateElementType();
            return(newTypeRef);
        }