protected override void VisitConstantParameterValue(ConstantParameterValue parameterValue)
 {
    InjectionParameter = parameterValue.Value;
 }
 /// <summary>
 /// The method called when a <see cref="T:Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConstantParameterValue"/> object is visited.
 /// </summary>
 /// <param name="parameterValue">The <see cref="T:Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConstantParameterValue"/> to process.</param>
 protected override void VisitConstantParameterValue(ConstantParameterValue parameterValue)
 {
     String key = ((MemberExpression)parameterValue.Expression).Member.Name;
     InjectionParameters = new Property[] { Property.ForKey(key).Eq(parameterValue.Value) };
 }
Exemple #3
0
 /// <summary>
 /// The method called when a <see cref="ConstantParameterValue"/> object is visited.
 /// </summary>
 /// <remarks>By default, this method throws an exception. Override it to provide your
 /// specific processing.</remarks>
 /// <param name="parameterValue">The <see cref="ConstantParameterValue"/> to process.</param>
 protected virtual void VisitConstantParameterValue(ConstantParameterValue parameterValue)
 {
     VisitParameterValue(parameterValue);
 }
 /// <summary>
 /// The method called when a
 /// <see cref="T:Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConstantParameterValue"/>
 /// object is visited.
 /// </summary>
 /// <param name="parameterValue">
 /// The <see cref="T:Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConstantParameterValue"/> to process.
 /// </param>
 /// <remarks>
 /// <para>
 /// This method creates a <see cref="Autofac.Core.ResolvedParameter"/>
 /// based on the constant value in <paramref name="parameterValue" />
 /// and ties it to the parameter passed in during construction.
 /// </para>
 /// </remarks>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown if <paramref name="parameterValue" /> is <see langword="null" />.
 /// </exception>
 protected override void VisitConstantParameterValue(ConstantParameterValue parameterValue)
 {
     if (parameterValue == null)
     {
         throw new ArgumentNullException("parameterValue");
     }
     this.AutofacParameter = this.CreateResolvedParameter((pi, context) => parameterValue.Value);
 }