Ejemplo n.º 1
0
        private InstanceProducer GetInstanceProducerFor(ParameterInfo parameter)
        {
            InstanceProducer producer = null;

            Container container = this.getContainer();

            if (container == null)
            {
                throw new InvalidOperationException(
                          StringResources.CanNotCallBuildParameterExpressionContainerOptionsNotPartOfContainer());
            }

            producer = container.GetRegistrationEvenIfInvalid(parameter.ParameterType);

            if (producer == null)
            {
                container.Options.ConstructorVerificationBehavior.Verify(parameter);

                throw new ActivationException(StringResources.ParameterTypeMustBeRegistered(
                                                  parameter.Member.DeclaringType, parameter));
            }

            return(producer);
        }