internal void GenerateCall(ConstructorStructure constructor) { Generator.Emit(OpCodes.Call, constructor.GainConstructor()); }
internal ConstructorInfo RenewConstructor(ConstructorStructure constructor) { if (Info.GetType().Name == "TypeBuilderInstantiation") { return TypeBuilder.GetConstructor(Info, constructor.GainConstructor()); } else { var c = constructor.GainConstructor(); var types = Info.RenewTypes(c.GetParameters().ToTypes()); var ret = Info.GetConstructor(types); if (ret == null) { throw new InvalidOperationException(); } return ret; } }
internal void GenerateNew(ConstructorStructure constructor) { Generator.Emit(OpCodes.Newobj, constructor.GainConstructor()); }