internal override void ResolveParent(PEReader buff, bool isExtern) { if (parent != null) return; CIx cIx = CIx.ResolutionScope; if (isExtern) cIx = CIx.Implementation; parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx); parent.ResolveParent(buff, isExtern); parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx); if (parent == null) return; NestedClassRef existing = parent.GetNestedClass(Name); if (existing == null) { scope = parent.GetScope(); parent.AddToClassList(this); } else if (isExtern) buff.InsertInTable(MDTable.ExportedType, Row, existing); else buff.InsertInTable(MDTable.TypeRef, Row, existing); }
internal override void Resolve(PEReader buff) { buff.InsertInTable(MDTable.TypeSpec, Row, buff.GetBlobType(blobIx)); this.unresolved = false; }
internal virtual void ResolveParent(PEReader buff, bool isExtern) { CIx cIx = CIx.ResolutionScope; if (isExtern) cIx = CIx.Implementation; if (scope != null) return; MetaDataElement parentScope = buff.GetCodedElement(cIx, resScopeIx); if (parentScope is Module) { // special code for glitch in Everett ilasm ClassDef newDef = new ClassDef((PEFile)parentScope, 0, NameSpace, Name); ((Module)parentScope).AddToClassList(newDef); buff.InsertInTable(MDTable.TypeRef, Row, newDef); } else { scope = (ReferenceScope)buff.GetCodedElement(cIx, resScopeIx); ClassRef existing = (ClassRef)scope.GetExistingClass(NameSpace, Name); if (existing == null) { scope.AddToClassList(this); } else { if (isExtern) buff.InsertInTable(MDTable.ExportedType, Row, existing); else buff.InsertInTable(MDTable.TypeRef, Row, existing); } } }