internal void PopulatePropertyAndEventTables() { if (properties != null) { PropertyMapTable.Record rec = new PropertyMapTable.Record(); rec.Parent = token; rec.PropertyList = this.ModuleBuilder.Property.RowCount + 1; this.ModuleBuilder.PropertyMap.AddRecord(rec); foreach (PropertyBuilder pb in properties) { pb.Bake(); } } if (events != null) { EventMapTable.Record rec = new EventMapTable.Record(); rec.Parent = token; rec.EventList = this.ModuleBuilder.Event.RowCount + 1; this.ModuleBuilder.EventMap.AddRecord(rec); foreach (EventBuilder eb in events) { eb.Bake(); } } }
public Type CreateType() { if ((typeFlags & TypeFlags.Baked) != 0) { // .NET allows multiple invocations (subsequent invocations return the same baked type) throw new NotImplementedException(); } typeFlags |= TypeFlags.Baked; foreach (MethodBuilder mb in methods) { mb.Bake(); } if (properties != null) { PropertyMapTable.Record rec = new PropertyMapTable.Record(); rec.Parent = token; rec.PropertyList = this.ModuleBuilder.Property.RowCount + 1; this.ModuleBuilder.PropertyMap.AddRecord(rec); foreach (PropertyBuilder pb in properties) { pb.Bake(); } properties = null; } if (events != null) { EventMapTable.Record rec = new EventMapTable.Record(); rec.Parent = token; rec.EventList = this.ModuleBuilder.Event.RowCount + 1; this.ModuleBuilder.EventMap.AddRecord(rec); foreach (EventBuilder eb in events) { eb.Bake(); } events = null; } if (declarativeSecurity != null) { this.ModuleBuilder.AddDeclarativeSecurity(token, declarativeSecurity); } return(new BakedType(this)); }
public Type CreateType() { if ((typeFlags & TypeFlags.Baked) != 0) { // .NET allows multiple invocations (subsequent invocations return the same baked type) throw new NotImplementedException(); } typeFlags |= TypeFlags.Baked; foreach (MethodBuilder mb in methods) { mb.Bake(); } if (properties != null) { PropertyMapTable.Record rec = new PropertyMapTable.Record(); rec.Parent = token; rec.PropertyList = this.ModuleBuilder.Property.RowCount + 1; this.ModuleBuilder.PropertyMap.AddRecord(rec); foreach (PropertyBuilder pb in properties) { pb.Bake(); } properties = null; } if (events != null) { EventMapTable.Record rec = new EventMapTable.Record(); rec.Parent = token; rec.EventList = this.ModuleBuilder.Event.RowCount + 1; this.ModuleBuilder.EventMap.AddRecord(rec); foreach (EventBuilder eb in events) { eb.Bake(); } events = null; } if (declarativeSecurity != null) { this.ModuleBuilder.AddDeclarativeSecurity(token, declarativeSecurity); } return new BakedType(this); }