示例#1
0
 internal static void Read(PEReader buff, TableRow[] typeRefs, bool resolve)
 {
     for (uint i = 0; i < typeRefs.Length; i++)
     {
         uint   resScopeIx = buff.GetCodedIndex(CIx.ResolutionScope);
         string name       = buff.GetString();
         string nameSpace  = buff.GetString();
         if (buff.CodedTable(CIx.ResolutionScope, resScopeIx) == MDTable.TypeRef)
         {
             typeRefs[i] = new NestedClassRef(resScopeIx, nameSpace, name);
         }
         else
         {
             typeRefs[i] = new ClassRef(resScopeIx, nameSpace, name);
         }
         typeRefs[i].Row = i + 1;
     }
     if (resolve)
     {
         foreach (TableRow typeRef in typeRefs)
         {
             ((ClassRef)typeRef).ResolveParent(buff, false);
         }
     }
 }