comparison 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
comparison
equal deleted inserted replaced
278:6691aff01de1 279:8714471e8d78
1 using System.Collections.Generic;
1 using System.Xml.Serialization; 2 using System.Xml.Serialization;
2 3
3 namespace Implab.ServiceHost.Unity { 4 namespace Implab.ServiceHost.Unity {
4 public class ValueElement : InstanceAbstractRegistration { 5 public class ValueElement : AbstractRegistration, IInstanceRegistration {
5 6
6 [XmlAttribute("value")] 7 [XmlAttribute("value")]
7 public string Value { get; set; } 8 public string Value { get; set; }
8 9
9 [XmlText] 10 [XmlText]
10 public string Text { get; set; } 11 public string Text { get; set; }
17 get { 18 get {
18 return RegistrationType; 19 return RegistrationType;
19 } 20 }
20 } 21 }
21 22
22 public override void Visit(InstanceRegistrationBuilder builder) { 23 public IEnumerable<IInjectionParameter> MemberInjections {
23 base.Visit(builder); 24 get {
24 var parameter = new ValueParameterElement { 25 yield return new ValueParameterElement {
25 Value = Value, 26 Value = Value,
26 Text = Text 27 Text = Text
27 }; 28 };
28 parameter.Visit(builder.ValueBuilder); 29 }
30 }
31
32 public override void Visit(ContainerBuilder builder) {
33 builder.Visit(this);
29 } 34 }
30 } 35 }
31 } 36 }