TypeReference readTypeRef() { string ns, name; parseReflectionTypeName(readString(), out ns, out name); var asmRef = assemblyNames[readVariableLengthInt32()]; var declaringType = readTypeReference(); var typeReference = new TypeReference(ns, name, module, asmRef) { DeclaringType = declaringType, }; typeReference.UpdateElementType(); typeReference = memberReferenceConverter.convert(typeReference); typeReference.IsValueType = isValueType(typeReference); return typeReference; }
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; }