internal sealed override void BuildTables(MetaData md) { if (done) return; if (pinvokeImpl != null) { md.AddToTable(MDTable.ImplMap,pinvokeImpl); pinvokeImpl.BuildTables(md); } if (entryPoint) md.SetEntryPoint(this); uint locToken = 0; if (locals != null) { localSig = new LocalSig(locals); md.AddToTable(MDTable.StandAloneSig,localSig); localSig.BuildTables(md); locToken = localSig.Token(); } if (code != null) { code.CheckCode(locToken,initLocals,maxStack); textOffset = md.AddCode(code); } nameIx = md.AddToStringsHeap(name); sigIx = GetSigIx(md); parIx = md.TableIndex(MDTable.Param); if (ret_param.HasMarshalInfo || ret_param.HasCustomAttr) { md.AddToTable(MDTable.Param, ret_param); ret_param.BuildTables(md); } for (int i=0; i < numPars; i++) { md.AddToTable(MDTable.Param,parList[i]); parList[i].BuildTables(md); } if (varArgSigList != null) { foreach (MethodRef varArgSig in varArgSigList) { md.AddToTable(MDTable.MemberRef,varArgSig); varArgSig.BuildTables(md); } } // Console.WriteLine("method has " + numPars + " parameters"); done = true; }
internal sealed override void BuildTables(MetaData md) { if (done) return; if ((flags & (uint)TypeAttr.Interface) != 0) { superType = null; } // Console.WriteLine("Building tables for " + name); if (layout != null) md.AddToTable(MDTable.ClassLayout,layout); // Console.WriteLine("adding methods " + methods.Count); methodIx = md.TableIndex(MDTable.Method); for (int i=0; i < methods.Count; i++) { md.AddToTable(MDTable.Method,(MetaDataElement)methods[i]); ((MethodDef)methods[i]).BuildTables(md); } // Console.WriteLine("adding fields"); fieldIx = md.TableIndex(MDTable.Field); for (int i=0; i < fields.Count; i++) { md.AddToTable(MDTable.Field,(MetaDataElement)fields[i]); ((FieldDef)fields[i]).BuildTables(md); } // Console.WriteLine("adding events and properties"); if (events != null) { for (int i=0; i < events.Count; i++) { md.AddToTable(MDTable.Event,(Event)events[i]); ((Event)events[i]).BuildTables(md); } md.AddToTable(MDTable.EventMap, new MapElem(this,((Event)events[0]).Row,MDTable.Event)); } if (properties != null) { for (int i=0; i < properties.Count; i++) { md.AddToTable(MDTable.Property,(Property)properties[i]); ((Property)properties[i]).BuildTables(md); } md.AddToTable(MDTable.PropertyMap,new MapElem(this, ((Property)properties[0]).Row,MDTable.Property)); } // Console.WriteLine("End of building tables"); done = true; }