public static TypeSignature ParseType(MetadataHeader header, string name)
{
int position = 0;
var defaultScope = header == null ? null : header.GetStream<TableStream>().GetTable<ModuleDefinition>()[0];
var type = ReadTypeSignature(defaultScope, name, ref position);
if (position >= name.Length)
return type;
position++;
SkipSpaces(name, ref position);
var elementType = ((TypeReference)type.GetElementType());
while (elementType.DeclaringType != null)
elementType = (TypeReference)elementType.DeclaringType;
if (position >= name.Length)
return type;
elementType.ResolutionScope = ReadAssemblyReference(name, ref position);
return type;
}