public ConventionConstructorInjectionBehavior(
     IConstructorInjectionBehavior decorated,
     IParameterConvention convention)
 {
     this.decorated  = decorated;
     this.convention = convention;
 }
Example #2
0
 public ContextualDecoratorInjectionBehavior(Container container,
                                             ContextualPredicateCollection contextualPredicates)
 {
     this.container            = container;
     this.contextualPredicates = contextualPredicates;
     this.defaultBehavior      = container.Options.ConstructorInjectionBehavior;
 }
Example #3
0
 /// <summary>Initializes a new instance of the <see cref="ContainerOptions"/> class.</summary>
 public ContainerOptions()
 {
     this.resolutionBehavior   = new DefaultConstructorResolutionBehavior();
     this.verificationBehavior = new DefaultConstructorVerificationBehavior();
     this.injectionBehavior    = new DefaultConstructorInjectionBehavior(() => this.Container);
     this.propertyBehavior     = new DefaultPropertySelectionBehavior();
     this.lifestyleBehavior    = new TransientLifestyleSelectionBehavior();
 }
Example #4
0
 internal static string ConstructorInjectionBehaviorReturnedNull(
     IConstructorInjectionBehavior injectionBehavior, ParameterInfo parameter)
 {
     return(string.Format(CultureInfo.InvariantCulture,
                          "The {0} that was registered through Container.Options.ConstructorInjectionBehavior " +
                          "returned a null reference after its BuildParameterExpression(ParameterInfo) method was " +
                          "supplied with the argument of type {1} with name '{2}' from the constructor of type {3}. " +
                          "{4}.BuildParameterExpression implementations should never return null, but should throw " +
                          "a {5} with an expressive message instead.",
                          injectionBehavior.GetType().ToFriendlyName(),
                          parameter.ParameterType.ToFriendlyName(), parameter.Name,
                          parameter.Member.DeclaringType.ToFriendlyName(),
                          typeof(IConstructorInjectionBehavior).Name,
                          typeof(ActivationException).FullName));
 }
 public OptionalArgumentsInjectionBehavior(Container container, IConstructorInjectionBehavior original)
 {
     this.container = container;
     this.original  = original;
 }
 public AutomaticParameterizedFactoriesHelper(ContainerOptions options)
 {
     this.container = options.Container;
     this.originalVerificationBehavior = options.ConstructorVerificationBehavior;
     this.originalInjectionBehavior    = options.ConstructorInjectionBehavior;
 }
 public OptionalParameterConvention(IConstructorInjectionBehavior injectionBehavior)
 {
     this.injectionBehavior = injectionBehavior;
 }
 public NamedConstructorInjectionBehavior(IConstructorInjectionBehavior defaultBehavior,
                                          Func <Type, string, InstanceProducer> keyedProducerRetriever)
 {
     this.defaultBehavior        = defaultBehavior;
     this.keyedProducerRetriever = keyedProducerRetriever;
 }