Mercurial > pub > ImplabNet
annotate Implab.ServiceHost/Unity/AbstractRegistration.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 |
---|---|
269 | 1 using System; |
2 using System.Xml.Serialization; | |
3 using Unity.Lifetime; | |
4 using Unity.Registration; | |
5 | |
6 namespace Implab.ServiceHost.Unity | |
7 { | |
277 | 8 /// <summary> |
9 /// Базовая информаци о регистрации в контейнере: тип, имя и время жизни | |
10 /// </summary> | |
11 public abstract class AbstractRegistration : AbstractContainerItem { | |
269 | 12 |
13 /// <summary> | |
14 /// An optional name for a registration in the container | |
15 /// </summary> | |
16 [XmlAttribute("name")] | |
17 public string Name { | |
18 get; set; | |
19 } | |
20 | |
277 | 21 [XmlElement("signleton", typeof(SingletonLifetimeElement))] |
271 | 22 [XmlElement("context", typeof(ContextLifetimeElement))] |
23 [XmlElement("container", typeof(ContainerLifetimeElement))] | |
24 [XmlElement("hierarchy", typeof(HierarchicalLifetimeElement))] | |
25 public LifetimeElement Lifetime {get; set;} | |
26 | |
27 /// <summary> | |
28 /// A type specification for the service registration, | |
29 /// </summary> | |
273
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
272
diff
changeset
|
30 [XmlAttribute("type")] |
79110a16cab7
Working on Unity xml configuration: Refactoring in progress
cin
parents:
272
diff
changeset
|
31 public string RegistrationType { get; set; } |
271 | 32 |
277 | 33 public virtual Type GetRegistrationType(Func<string,Type> resolver) { |
34 return resolver(RegistrationType); | |
35 } | |
36 | |
37 public virtual void Visit(RegistrationBuilder builder) { | |
38 Lifetime?.Visit(builder); | |
39 } | |
40 | |
269 | 41 } |
42 } |