public ConstructorGen Constructor() { if (TypeBuilder.IsInterface) { throw new InvalidOperationException(Messages.ErrInterfaceNoCtor); } ConstructorGen cg = new ConstructorGen(this, _mthVis, _implFlags); ResetAttrs(); return(cg); }
public ConstructorGen Constructor() { if (tb.IsInterface) { throw new InvalidOperationException(Properties.Messages.ErrInterfaceNoCtor); } ConstructorGen cg = new ConstructorGen(this, mthVis, implFlags); ResetAttrs(); return(cg); }
public ConstructorGen Constructor() { if (tb.IsInterface) { throw new InvalidOperationException("Interface cannot define a constructor"); } ConstructorGen cg = new ConstructorGen(this, mthVis, implFlags); ResetAttrs(); return(cg); }
internal CodeGen(ICodeGenContext context) { this.context = context; this.cg = context as ConstructorGen; if (cg != null && cg.IsStatic) { // #14 - cg is relevant for instance constructors - it wreaks havoc in a static constructor cg = null; } il = context.GetILGenerator(); }
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); }
public ConstructorGen StaticConstructor() { if (tb.IsInterface) { throw new InvalidOperationException("Interface cannot define a constructor"); } if (staticCtor == null) { staticCtor = new ConstructorGen(this, MethodAttributes.Static, 0).LockSignature(); } return(staticCtor); }
public void Register(ConstructorGen constructor) { if (constructor.IsStatic) { return; } if (constructor.ParameterCount == 0 && tb.IsValueType) { throw new InvalidOperationException("Value types cannot have default constructors"); } constructors.Add(constructor); }
public ConstructorGen StaticConstructor() { if (TypeBuilder.IsInterface) { throw new InvalidOperationException(Messages.ErrInterfaceNoCtor); } if (_staticCtor == null) { _staticCtor = new ConstructorGen(this, MethodAttributes.Static, 0).LockSignature(); } return(_staticCtor); }
public CodeGen(ICodeGenContext context, bool isOwner = true) { _isOwner = isOwner; Context = context; #if !PHONE8 _cg = context as ConstructorGen; if (_cg != null && _cg.IsStatic) { // #14 - cg is relevant for instance constructors - it wreaks havoc in a static constructor _cg = null; } #endif IL = context.GetILGenerator(); }
public CodeGen(ICodeGenContext context) { this.context = context; this.cg = context as ConstructorGen; il = context.GetILGenerator(); }