Ejemplo n.º 1
0
        public MutableConstructorInfo AddConstructor(
            MethodAttributes attributes, IEnumerable <ParameterDeclaration> parameters, Func <ConstructorBodyCreationContext, Expression> bodyProvider)
        {
            ArgumentUtility.CheckNotNull("parameters", parameters);
            ArgumentUtility.CheckNotNull("bodyProvider", bodyProvider);

            var constructor = _mutableMemberFactory.CreateConstructor(this, attributes, parameters, bodyProvider);

            if (constructor.IsStatic)
            {
                Assertion.IsNull(_typeInitializer);
                _typeInitializer = constructor;
            }
            else
            {
                _addedConstructors.Add(constructor);
            }

            return(constructor);
        }