Mercurial > pub > ImplabNet
diff Implab.ServiceHost/Unity/ValueElement.cs @ 279:8714471e8d78 v3
Container configuration cleanup, RC2
author | cin |
---|---|
date | Fri, 04 May 2018 18:12:42 +0300 |
parents | 963b17c275be |
children |
line wrap: on
line diff
--- a/Implab.ServiceHost/Unity/ValueElement.cs Thu May 03 09:59:44 2018 +0300 +++ b/Implab.ServiceHost/Unity/ValueElement.cs Fri May 04 18:12:42 2018 +0300 @@ -1,8 +1,9 @@ +using System.Collections.Generic; using System.Xml.Serialization; namespace Implab.ServiceHost.Unity { - public class ValueElement : InstanceAbstractRegistration { - + public class ValueElement : AbstractRegistration, IInstanceRegistration { + [XmlAttribute("value")] public string Value { get; set; } @@ -19,13 +20,17 @@ } } - public override void Visit(InstanceRegistrationBuilder builder) { - base.Visit(builder); - var parameter = new ValueParameterElement { - Value = Value, - Text = Text - }; - parameter.Visit(builder.ValueBuilder); + public IEnumerable<IInjectionParameter> MemberInjections { + get { + yield return new ValueParameterElement { + Value = Value, + Text = Text + }; + } + } + + public override void Visit(ContainerBuilder builder) { + builder.Visit(this); } } } \ No newline at end of file