Beispiel #1
0
 public OrderedParametersOverride(IEnumerable <object> parameterValues)
 {
     this.parameterValues = new Queue <InjectionParameterValue>();
     foreach (var parameterValue in parameterValues)
     {
         this.parameterValues.Enqueue(InjectionParameterValue.ToParameter(parameterValue));
     }
 }
Beispiel #2
0
 /// <summary>
 /// Configure the container to inject the given property name,
 /// using the value supplied. This value is converted to an
 /// <see cref="InjectionParameterValue"/> object using the
 /// rules defined by the <see cref="InjectionParameterValue.ToParameters"/>
 /// method.
 /// </summary>
 /// <param name="propertyName">Name of property to inject.</param>
 /// <param name="propertyValue">Value for property.</param>
 public InjectionProperty(string propertyName, object propertyValue)
 {
     this.propertyName   = propertyName;
     this.parameterValue = InjectionParameterValue.ToParameter(propertyValue);
 }
Beispiel #3
0
 /// <summary>
 /// Create an instance of <see cref="DependencyOverride"/> to override
 /// the given type with the given value.
 /// </summary>
 /// <param name="typeToConstruct">Type of the dependency.</param>
 /// <param name="dependencyValue">Value to use.</param>
 public DependencyOverride(Type typeToConstruct, object dependencyValue)
 {
     this.typeToConstruct = typeToConstruct;
     this.dependencyValue = InjectionParameterValue.ToParameter(dependencyValue);
 }
Beispiel #4
0
 /// <summary>
 /// Construct a new <see cref="ParameterOverride"/> object that will
 /// override the given named constructor parameter, and pass the given
 /// value.
 /// </summary>
 /// <param name="parameterName">Name of the constructor parameter.</param>
 /// <param name="parameterValue">Value to pass for the constructor.</param>
 public ParameterOverride(string parameterName, object parameterValue)
 {
     this.parameterName  = parameterName;
     this.parameterValue = InjectionParameterValue.ToParameter(parameterValue);
 }