public ConstructorGen Constructor() { if (tb.IsInterface) { throw new InvalidOperationException(Properties.Messages.ErrInterfaceNoCtor); } ConstructorGen cg = new ConstructorGen(this, mthVis, implFlags); ResetAttrs(); return(cg); }
internal void Register(ConstructorGen constructor) { if (constructor.IsStatic) { return; } if (constructor.ParameterCount == 0 && tb.IsValueType) { throw new InvalidOperationException(Properties.Messages.ErrStructNoDefaultCtor); } constructors.Add(constructor); }
public ConstructorGen StaticConstructor() { if (tb.IsInterface) { throw new InvalidOperationException(Properties.Messages.ErrInterfaceNoCtor); } if (staticCtor == null) { staticCtor = new ConstructorGen(this, MethodAttributes.Static, 0).LockSignature(); } return(staticCtor); }
internal CodeGen(ICodeGenContext context) { this.context = context; this.cg = context as ConstructorGen; il = context.GetILGenerator(); }