Ildasm.Disassembler.ReadType C# (CSharp) Method

ReadType() private method

private ReadType ( ByteReader br, string &typeName ) : Managed.Reflection.Type
br ByteReader
typeName string
return Managed.Reflection.Type
        Type ReadType(ByteReader br, out string typeName)
        {
            typeName = br.ReadString();
            if (typeName == null)
            {
                return null;
            }
            if (typeName.Length > 0 && typeName[typeName.Length - 1] == 0)
            {
                // there are broken compilers that emit an extra NUL character after the type name
                typeName = typeName.Substring(0, typeName.Length - 1);
            }
            var type = universe.ResolveType(assembly, typeName);
            if (type != null && type.Assembly == mscorlib)
            {
                // we don't want that!
                type = universe.ResolveType(assembly, type.FullName + ", mscorlib, Version=0.0.0.0");
            }
            return type;
        }