public void CreateDefaultConstructor()
        {
            if (TypeBuilder.IsInterface)
            {
                throw new InvalidOperationException("Interfaces cannot have constructors.");
            }

            constructors.Add(new ConstructorEmitter(this));
        }
Пример #2
0
        public ConstructorEmitter CreateConstructor(params ArgumentReference[] arguments)
        {
            if (TypeBuilder.IsInterface)
            {
                throw new InvalidOperationException("Interfaces cannot have constructors.");
            }

            var member = new ConstructorEmitter(this, arguments);
            constructors.Add(member);
            return member;
        }