Esempio n. 1
0
        /// <summary>Initializes a new instance of the <see cref="InjectionConsumerInfo"/> class.</summary>
        /// <param name="parameter">The constructor parameter for the created component.</param>
        public InjectionConsumerInfo(ParameterInfo parameter)
        {
            Requires.IsNotNull(parameter, nameof(parameter));

            this.target             = new InjectionTargetInfo(parameter);
            this.implementationType = parameter.Member.DeclaringType;
        }
 internal void ThrowParameterTypeMustBeRegistered(InjectionTargetInfo target)
 {
     throw new ActivationException(
               StringResources.ParameterTypeMustBeRegistered(
                   target,
                   this.GetNumberOfConditionalRegistrationsFor(target.TargetType)));
 }
Esempio n. 3
0
        /// <summary>Initializes a new instance of the <see cref="InjectionConsumerInfo"/> class.</summary>
        /// <param name="implementationType">The implementation type of the consumer of the component that should be created.</param>
        /// <param name="property">The property for the created component.</param>
        public InjectionConsumerInfo(Type implementationType, PropertyInfo property)
        {
            Requires.IsNotNull(implementationType, nameof(implementationType));
            Requires.IsNotNull(property, nameof(property));

            this.target             = new InjectionTargetInfo(property);
            this.implementationType = implementationType;
        }
Esempio n. 4
0
 internal void ThrowParameterTypeMustBeRegistered(InjectionTargetInfo target)
 {
     throw new ActivationException(
               StringResources.ParameterTypeMustBeRegistered(
                   target,
                   this.GetNumberOfConditionalRegistrationsFor(target.TargetType),
                   this.ContainsOneToOneRegistrationForCollectionType(target.TargetType),
                   this.ContainsCollectionRegistrationFor(target.TargetType),
                   this.GetNonGenericDecoratorsThatWereSkippedDuringBatchRegistration(target.TargetType)));
 }
        internal void ThrowParameterTypeMustBeRegistered(InjectionTargetInfo target)
        {
            var type = target.TargetType;

            throw new ActivationException(
                      StringResources.ParameterTypeMustBeRegistered(
                          container: this,
                          target: target,
                          numberOfConditionals: this.GetNumberOfConditionalRegistrationsFor(type),
                          hasRelatedOneToOneMapping: this.ContainsOneToOneRegistrationForCollection(type),
                          collectionRegistrationDoesNotExists: this.IsCollectionButNoOneToToOneRegistrationExists(type),
                          hasRelatedCollectionMapping: this.ContainsCollectionRegistrationFor(type),
                          skippedDecorators: this.GetNonGenericDecoratorsSkippedDuringAutoRegistration(type),
                          lookalikes: this.GetLookalikesForMissingType(type)));
        }