Mercurial > pub > ImplabNet
annotate Implab.ServiceHost/Unity/ValueElement.cs @ 277:963b17c275be v3
Refactoring
Added <array> element to injection parameters
Working on registrations of factories
author | cin |
---|---|
date | Sat, 28 Apr 2018 18:48:09 +0300 |
parents | 22629bf26121 |
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 } |