comparison Implab.ServiceHost/Unity/ValueElement.cs @ 274:22629bf26121 v3

Unity xml configuration, alpha2
author cin
date Fri, 27 Apr 2018 04:47:52 +0300
parents 79110a16cab7
children 963b17c275be
comparison
equal deleted inserted replaced
273:79110a16cab7 274:22629bf26121
1 using System.Xml.Serialization; 1 using System.Xml.Serialization;
2 2
3 namespace Implab.ServiceHost.Unity { 3 namespace Implab.ServiceHost.Unity {
4 public class ValueElement : AbstractRegistration, ITextValue { 4 public class ValueElement : AbstractRegistration, ITextValue {
5 5
6 [XmlText]
7 [XmlAttribute("value")] 6 [XmlAttribute("value")]
8 public string Value { get; set; } 7 public string Value { get; set; }
9 8
10 public override void Visit(ContainerContext context) { 9 [XmlText]
10 public string Text { get; set; }
11
12 string ITextValue.Value {
13 get {
14 return string.IsNullOrEmpty(Value) ? Text : Value;
15 }
16 }
17
18 public string TypeName {
19 get {
20 return RegistrationType;
21 }
22 }
23
24 public override void Visit(ContainerBuilder context) {
11 context.Visit(this); 25 context.Visit(this);
12 } 26 }
13 } 27 }
14 } 28 }