Mercurial > pub > ImplabNet
comparison Implab.ServiceHost/Unity/AbstractRegistration.cs @ 279:8714471e8d78 v3
Container configuration cleanup, RC2
| author | cin |
|---|---|
| date | Fri, 04 May 2018 18:12:42 +0300 |
| parents | 963b17c275be |
| children |
comparison
equal
deleted
inserted
replaced
| 278:6691aff01de1 | 279:8714471e8d78 |
|---|---|
| 6 namespace Implab.ServiceHost.Unity | 6 namespace Implab.ServiceHost.Unity |
| 7 { | 7 { |
| 8 /// <summary> | 8 /// <summary> |
| 9 /// Базовая информаци о регистрации в контейнере: тип, имя и время жизни | 9 /// Базовая информаци о регистрации в контейнере: тип, имя и время жизни |
| 10 /// </summary> | 10 /// </summary> |
| 11 public abstract class AbstractRegistration : AbstractContainerItem { | 11 public abstract class AbstractRegistration : AbstractContainerItem, IRegistration { |
| 12 | 12 |
| 13 /// <summary> | 13 /// <summary> |
| 14 /// An optional name for a registration in the container | 14 /// An optional name for a registration in the container |
| 15 /// </summary> | 15 /// </summary> |
| 16 [XmlAttribute("name")] | 16 [XmlAttribute("name")] |
| 28 /// A type specification for the service registration, | 28 /// A type specification for the service registration, |
| 29 /// </summary> | 29 /// </summary> |
| 30 [XmlAttribute("type")] | 30 [XmlAttribute("type")] |
| 31 public string RegistrationType { get; set; } | 31 public string RegistrationType { get; set; } |
| 32 | 32 |
| 33 public virtual LifetimeManager GetLifetime(ContainerBuilder builder) { | |
| 34 return Lifetime?.GetLifetime(builder); | |
| 35 } | |
| 36 | |
| 33 public virtual Type GetRegistrationType(Func<string,Type> resolver) { | 37 public virtual Type GetRegistrationType(Func<string,Type> resolver) { |
| 34 return resolver(RegistrationType); | 38 return resolver(RegistrationType); |
| 35 } | 39 } |
| 36 | 40 |
| 37 public virtual void Visit(RegistrationBuilder builder) { | 41 public virtual Type GetRegistrationType(ContainerBuilder builder) { |
| 38 Lifetime?.Visit(builder); | 42 return builder.ResolveType(RegistrationType); |
| 39 } | 43 } |
| 44 | |
| 45 | |
| 40 | 46 |
| 41 } | 47 } |
| 42 } | 48 } |
