Mercurial > pub > ImplabNet
annotate Implab.ServiceHost/Unity/ValueElement.cs @ 281:e0916ddc9950 v3 tip
code cleanup and refactoring
author | cin |
---|---|
date | Fri, 01 Jun 2018 21:35:24 +0300 |
parents | 8714471e8d78 |
children |
rev | line source |
---|---|
279 | 1 using System.Collections.Generic; |
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
2 using System.Xml.Serialization; |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
3 |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
4 namespace Implab.ServiceHost.Unity { |
279 | 5 public class ValueElement : AbstractRegistration, IInstanceRegistration { |
6 | |
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
7 [XmlAttribute("value")] |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
8 public string Value { get; set; } |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
9 |
274 | 10 [XmlText] |
11 public string Text { get; set; } | |
12 | |
277 | 13 string GetTextValue() { |
14 return string.IsNullOrEmpty(Value) ? Text : Value; | |
274 | 15 } |
16 | |
17 public string TypeName { | |
18 get { | |
19 return RegistrationType; | |
20 } | |
21 } | |
22 | |
279 | 23 public IEnumerable<IInjectionParameter> MemberInjections { |
24 get { | |
25 yield return new ValueParameterElement { | |
26 Value = Value, | |
27 Text = Text | |
28 }; | |
29 } | |
30 } | |
31 | |
32 public override void Visit(ContainerBuilder builder) { | |
33 builder.Visit(this); | |
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
34 } |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
35 } |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
diff
changeset
|
36 } |