Mercurial > pub > ImplabNet
annotate Implab.ServiceHost/Unity/ValueElement.cs @ 278:6691aff01de1 v3
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
Implab.ServiceHost: rewritten TypeReference (added support for nested types), stable API
author | cin |
---|---|
date | Thu, 03 May 2018 09:59:44 +0300 |
parents | 963b17c275be |
children | 8714471e8d78 |
rev | line source |
---|---|
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
1 using System.Xml.Serialization; |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
2 |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
3 namespace Implab.ServiceHost.Unity { |
277 | 4 public class ValueElement : InstanceAbstractRegistration { |
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
5 |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
6 [XmlAttribute("value")] |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
7 public string Value { get; set; } |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
8 |
274 | 9 [XmlText] |
10 public string Text { get; set; } | |
11 | |
277 | 12 string GetTextValue() { |
13 return string.IsNullOrEmpty(Value) ? Text : Value; | |
274 | 14 } |
15 | |
16 public string TypeName { | |
17 get { | |
18 return RegistrationType; | |
19 } | |
20 } | |
21 | |
277 | 22 public override void Visit(InstanceRegistrationBuilder builder) { |
23 base.Visit(builder); | |
24 var parameter = new ValueParameterElement { | |
25 Value = Value, | |
26 Text = Text | |
27 }; | |
28 parameter.Visit(builder.ValueBuilder); | |
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
29 } |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
30 } |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
31 } |